Note. Boxplots display the interquartile range (IQR, center box), and the whiskers extend 1.5*IQR from the lower and upper hinge. The white point indicates the mean and the white center line indicates the median.




Data Preparation

In an initial preparatory step, we import the data into the R project environment and prepare the variables for further processing and later analyses.

Data Import

The data were collected using two different survey tools. For the study with sojourners (Study 1: worker) we used the survey platform Qualtrics XM, whereas the studies with international students (Study 2: student), and the international medical professionals (Study 3: medical) were conducted using the survey framework FormR. This means that the datasets had inconsistent file formats and naming conventions. For the Qualtrics study we pre-processed some variables to ease the import process (for the syntax files see the SPS files in ‘data/S1_Workers/processed/cleaned’ and for the raw data files see ‘data/S1_Workers/raw’). For the two other studies, we import the raw csv files from their respective folders.

# Load variable name lookup table
varNames <- readxl::read_excel("preregistration/varNames.xlsx")

# rename function
reNam <- function(data = NA, names = varNames, study = "S1", survey = "pre") {
  # for testing
  # data = dtS1$raw.pre
  # names = varNames
  # study = "S1"
  # survey = "pre"
  
  var <- paste0("survey", study)
  varNamOld <- paste0("varNam", study)
  
  nameTbl <- names %>%
    filter((!!sym(var)) == survey) %>%
    select(varNam, varNamOld = (!!sym(varNamOld)))
  
  data.table::setnames(data, as.character(nameTbl$varNamOld), as.character(nameTbl$varNam), skip_absent=TRUE)
  
  return(data)
}

# workers
# initial data cleaning was done in SPSS (syntax files are available in "")
dtS1 <- list(
  raw.pre = read_spss("data/S1_Workers/processed/cleaned/MT - Pre-Measure - 06-15-2018.sav") %>% 
    reNam(data = ., names = varNames, study = "S1", survey = "pre"),
  raw.post = read_spss("data/S1_Workers/processed/cleaned/MT - Post-Measure - 06-15-2018.sav") %>% 
    reNam(data = ., names = varNames, study = "S1", survey = "post"),
  raw.morning = read_spss("data/S1_Workers/processed/cleaned/MT - Morning - 06-15-2018.sav") %>% 
    reNam(data = ., names = varNames, study = "S1", survey = "daily"),
  raw.afternoon = read_spss("data/S1_Workers/processed/cleaned/MT - Afternoon - 06-15-2018.sav") %>% 
    reNam(data = ., names = varNames, study = "S1", survey = "daily")
)

# students
dtS2 <- list(
  raw.pre = read.csv(file = "data/S2_Students/raw/AOTS_Pre.csv", header = T, sep = ",") %>% 
    reNam(data = ., names = varNames, study = "S2", survey = "pre"),
  raw.post = read.csv(file = "data/S2_Students/raw/AOTS_Post.csv", header = T, sep = ",") %>% 
    reNam(data = ., names = varNames, study = "S2", survey = "post"),
  raw.daily = read.csv(file = "data/S2_Students/raw/AOTS_Daily.csv", header = T, sep = ",") %>% 
    reNam(data = ., names = varNames, study = "S2", survey = "daily")
)

# young medical professionals
dtS3 <- list(
  raw.eligibility = read.csv("data/S3_Medical/raw/AOTM_Eligibility.csv") %>% 
    reNam(data = ., names = varNames, study = "S3", survey = "pre_entry"), # works but should be 'survey = "pre_elig"'
  raw.pre = read.csv("data/S3_Medical/raw/AOTM_Pre.csv") %>% 
    reNam(data = ., names = varNames, study = "S3", survey = "pre_entry"),
  raw.post = read.csv("data/S3_Medical/raw/AOTM_Post.csv") %>% 
    reNam(data = ., names = varNames, study = "S3", survey = "post"),
  raw.daily = read.csv("data/S3_Medical/raw/AOTM_Daily.csv") %>% 
    reNam(data = ., names = varNames, study = "S3", survey = "daily")
)


# # FROM INITIAL VAR NAME EXPORT [LEGACY]
# # export var names
# S1Nam <- rbind(
#   data.frame(
#     study = "S1",
#     survey = "pre",
#     varNam = names(dtS1$raw.pre)
#   ),
#   data.frame(
#     study = "S1",
#     survey = "daily",
#     varNam = names(dtS1$raw.afternoon)
#   ),
#   data.frame(
#     study = "S1",
#     survey = "post",
#     varNam = names(dtS1$raw.post)
#   )
# )
# S2Nam <- rbind(
#   data.frame(
#     study = "S2",
#     survey = "pre",
#     varNam = names(dtS2$raw.pre)
#   ),
#   data.frame(
#     study = "S2",
#     survey = "daily",
#     varNam = names(dtS2$raw.daily)
#   ),
#   data.frame(
#     study = "S2",
#     survey = "post",
#     varNam = names(dtS2$raw.post)
#   )
# )
# S3Nam <- rbind(
#   data.frame(
#     study = "S3",
#     survey = "pre_elig",
#     varNam = names(dtS3$raw.eligibility)
#   ),
#   data.frame(
#     study = "S3",
#     survey = "pre_entry",
#     varNam = names(dtS3$raw.pre)
#   ),
#   data.frame(
#     study = "S3",
#     survey = "daily",
#     varNam = names(dtS3$raw.daily)
#   ),
#   data.frame(
#     study = "S3",
#     survey = "post",
#     varNam = names(dtS3$raw.post)
#   )
# )
# write.csv(
#   x = rbind(
#     S1Nam,
#     S2Nam,
#     S3Nam
#   ),
#   file = "preregistration/varNames.csv"
# )

Data Cleaning & Data Exclusions

Worker

For the sojourner sample data was collected in four separate surveys: (1) the pre-measurement, (2) the daily morning survey, (3) the daily afternoon survey, as well as (4) a post-measurement. We combine the four individual surveys into one cohesive dataframe and drop superfluous variables that are not relevant to the analyses relevant here. We then format the time and date variables and add person- and measurement indices (for easy and meaningful addressing of the data). We also exclude our own test data.
Note: All data preparation steps are saved in the ‘dtS1’ list.

# Create reduced data sets for morning and afternoon
dat.mo <- dtS1$raw.morning %>%
  select(-starts_with("t_"))
#setdiff(names(dtS1$raw.morning), names(dat.mo))
dat.mo$daytime <- "morning"

dat.af <- dtS1$raw.afternoon %>%
  select(-starts_with("t_"))
dat.af$daytime <- "afternoon"

# merge morning and afternoon measurements with indicator [+ clean up]
daily.dat <- plyr::rbind.fill(dat.mo, dat.af)
daily.dat <- daily.dat[daily.dat$last_outside_referrer != 55951, ]
dtS1$daily <- daily.dat
rm(dat.mo, dat.af, daily.dat)

# reduced data set for pre measurement
dat.pre.red <- dtS1$raw.pre %>%
  select(-starts_with("t_"))
names(dat.pre.red) <- paste(names(dat.pre.red), "pre", sep = ".")

# merge with daily data [+ clean up]
df.pre <- merge(
  x = dtS1$daily,
  y = dat.pre.red,
  by.x = "last_outside_referrer",
  by.y = "platformId.pre",
  all = T
)

# adjust duplicate names to fit to indicate daily or pre measurement
names(df.pre) <- gsub("[[:punct:]]x", ".daily", names(df.pre))
names(df.pre) <- gsub("[[:punct:]]y", ".pre", names(df.pre))

# reduced data set for post-measurement
dat.post.red <- dtS1$raw.post %>%
  select(-starts_with("t_"))
names(dat.post.red) <- paste(names(dat.post.red), "post", sep = ".")

# merge post measurement with pre- and daily data
df <- merge(
  x = df.pre,
  y = dat.post.red,
  by.x = "last_outside_referrer",
  by.y = "last_outside_referrer.post",
  all = T
)

# adjust duplicate names to indicate pre or post
names(df) <- gsub("[[:punct:]]x", ".pre", names(df))
names(df) <- gsub("[[:punct:]]y", ".post", names(df))

# add to list
dtS1$combined <- df
rm(df, df.pre, dat.post.red, dat.pre.red)

# create data frame with cleaned data
df <- dtS1$combined %>%
  filter(
    Finished.pre == 1,
    Finished == 1,
    !is.na(last_outside_referrer)
  )

# add running number as measurement ID within participants
df$measureID <- data.table::rowidv(df, cols = c("last_outside_referrer"))

df <- df %>%
  mutate(
    PID = as.numeric(factor(last_outside_referrer)),
    # participant ID
    TID = measureID - 1,
    # time ID with t0 = 0 for meaningfull intercept interpretations
    date = substr(created, 1, 10),
    # awkward way of extracting date (best converted to )
    time = substr(created, 12, 19),
    # awkward way of extracting time
    daynum = as.numeric(factor(dateQualtrics)),
    # all days as numeric for ordering
    daycor = ifelse(
      daytime == "morning" &
        period_to_seconds(hms(time)) < period_to_seconds(hms("12:00:00")) |
        daytime == "afternoon" &
          period_to_seconds(hms(time)) < period_to_seconds(hms("19:00:00")),
      daynum - 1,
      daynum
    ),
    # correctly identify which date the questionnaire is about
    daycor.lead = sprintf("%02d", daycor),
    daytime.lt = ifelse(daytime == "morning", "a", "b"),
    # morning / afternoon to a / b
    day_time = paste(daycor.lead, daytime.lt, sep = "_"),
    # combine day id with morning / afternoon
    ResponseId = as.numeric(factor(day_time)),
    # day and time identifier as numeric id
    SubTime = chron::times(time.0),
    time.daily = as.character(time),
    PPDate = as.Date(df$dateQualtrics),
    number = replace_na(ContactNum, 0),
    NonDutchNum = replace_na(NonDutchNum, 0)
  )

dtS1$clean <- df

# clean up
rm(df)

# Export reduced Data
# write.csv(dtS1$clean, "data/processed/MT_clean-merged_07-05-2018.csv", row.names = F)
# save(dtS1$clean, file = "data/processed/MT_clean-merged_07-05-2018.RData")

Student

For the student sample data was, similarly, collected in three separate surveys: (1) the pre-measurement, (2) the daily survey sent out at lunch and dinner time, and (3) a post-measurement. We combine the three individual surveys into one large dataframe and drop superfluous variables that are not relevant to the analyses relevant here. We exclude our own test data as well as one participant who entered the study twice (but gave different responses during the pre-measurement). We also reformat missing values and format core ID variables.
Note: All data preparation steps are saved in the ‘dtS2’ list.

# our own test IDs
ownIDs <- c(
  "beautifulLionfishXXXR5rcgVBzGu8hPvOqrK8UBJBw4owvi9nfRFSFu3lMzYhE",
  "niceDogoXXXmB8JI5SFu78SF3DVof84mGUPPNUr14p2HYFTtp31a6D1OwAzM6F-K",
  "amusedQuailXXXmhuc_fpTp8vPkMwDH1BzjaH1d1kHSO1bsPEfsnaEYk4WeVBfPi",
  "juwGAbtXX0_1kmZtSVqKh3PGaHOICqUyU4iBkrT3nDsI_uifuD1gzKcZerxaM5FL"
)

# Prepare dfs for Cleaning
df.pre <- dtS2$raw.pre %>%
  mutate_all(na_if, "") %>%
  mutate_all(na_if, "NA") %>%
  filter(!is.na(ended)) %>% # remove all who did not finish
  filter(!email %in% .$email[duplicated(.$email)]) %>% # remove all who did the pre questionnaire multiple times (b/c inconsistent ratings scales)
  filter(!ResponseId %in% ownIDs) %>% # remove our own test
  mutate(ResponseId = as.character(ResponseId)) # turn factor into character strings (probably just precaution)
names(df.pre) <- paste(names(df.pre), "pre", sep = ".")

df.post <- dtS2$raw.post %>%
  mutate_all(na_if, "") %>%
  mutate_all(na_if, "NA") %>%
  filter(!is.na(ResponseId)) %>% # remove own test runs
  filter(!ResponseId %in% ownIDs) %>% # remove our own test
  filter(ResponseId %in% df.pre$ResponseId) %>% # remove anyone who wasn't in the pre
  filter(!is.na(ended)) %>% # remove all who never finished
  filter(!ResponseId %in% .$ResponseId[duplicated(.$ResponseId)]) %>% # remove all duplicate ResponseIds
  mutate(ResponseId = as.character(ResponseId)) # turn factor into character strings (probably just precaution)
names(df.post) <- paste(names(df.post), "post", sep = ".")

df.daily <- dtS2$raw.daily %>%
  mutate_all(na_if, "") %>%
  mutate_all(na_if, "NA") %>%
  filter(!ResponseId %in% ownIDs) %>% # remove our own test
  filter(ResponseId %in% df.pre$ResponseId) %>% # remove anyone who wasn't in the pre
  filter(!is.na(ended)) %>% # remove all who never finished
  mutate(ResponseId = as.character(ResponseId)) # turn factor into character strings (probably just precaution)

# merge daily with pre
dfPreDaily <- merge(
  x = df.daily,
  y = df.pre,
  by.x = "ResponseId",
  by.y = "ResponseId.pre", 
  suffixes = c(".daily", ".pre"),
  all = FALSE
)

# merge daily with post
dfCombined <- merge(
  x = dfPreDaily,
  y = df.post,
  by.x = "ResponseId",
  by.y = "ResponseId.post", 
  suffixes = c(".pre", ".post"),
  all = FALSE
)

# add to list
dtS2$clean <- dfCombined

# clean up workspace
rm(df.pre, df.daily, df.post, dfPreDaily, dfCombined, ownIDs)

Medical

For the medical professionals sample data was, again, collected in three separate surveys: (1) the pre-measurement, (2) the daily survey sent out at lunch and dinner time, and (3) a post-measurement. We combine the three individual surveys into one large dataframe. We exclude our own test data. We also reformat missing values and format core ID variables.
Note: All data preparation steps are saved in the ‘dtS3’ list.

# our own test IDs
ownIDs <- c(
  "test_LeonieXXXSklxecPLW0-FBPM4796o3pUwUhAY5jb9KGw8jQsKxWmGpa1Jiy", 
  "test_MaxXXXtOp_5dTNefIq0yKXtXt2IN6eEKxeHoPY9mlyvdsqPpLp1B0NGg4UL",
  "test_JannisXXXBsNqk62fOpX6chbd2tMWPptUdjjnhAqnQ3uBqckZ7gLIEoPlfZ",
  "quaintLeopardCatXXXAJ9cfSj-_SZLwNwMDxv_xv_iyr1Bg5YFLTlYdrjW0UXZY",
  "blue-eyedIndianElephantXXXLf5zPMpQCDGS3umFzIj-YVky7ivTItvvozW49m"
)

# Prepare dfs for Cleaning
df.pre <- dtS3$raw.pre %>%
  mutate_all(na_if, "") %>%
  mutate_all(na_if, "NA") %>%
  filter(!is.na(ended)) %>% # remove all who did not finish
  filter(!ResponseId %in% ownIDs) %>% # remove our own test
  mutate(ResponseId = as.character(ResponseId)) # turn factor into character strings (probably just precaution)
names(df.pre) <- paste(names(df.pre), "pre", sep = ".")

df.post <- dtS3$raw.post %>%
  mutate_all(na_if, "") %>%
  mutate_all(na_if, "NA") %>% 
  filter(!is.na(ResponseId)) %>% # remove own test runs
  filter(!ResponseId %in% ownIDs) %>% # remove our own test
  filter(ResponseId %in% df.pre$ResponseId) %>% # remove anyone who wasn't in the pre
  #filter(!is.na(ended)) %>% # remove all who never finished [disabled because only relevant if data is missing]
  filter(!ResponseId %in% .$ResponseId[duplicated(.$ResponseId)]) %>% # remove all duplicate ResponseIds
  mutate(ResponseId = as.character(ResponseId)) # turn factor into character strings (probably just precaution)
names(df.post) <- paste(names(df.post), "post", sep = ".")

df.daily <- dtS3$raw.daily %>%
  mutate_all(na_if, "") %>%
  mutate_all(na_if, "NA") %>%
  filter(!ResponseId %in% ownIDs) %>% # remove our own test
  filter(ResponseId %in% df.pre$ResponseId) %>% # remove anyone who wasn't in the pre
  #filter(!is.na(ended)) %>% # remove all who never finished [disabled because only relevant if data is missing]
  mutate(ResponseId = as.character(ResponseId)) # turn factor into character strings (probably just precaution)

# merge daily with pre
dfPreDaily <- merge(
  x = df.daily,
  y = df.pre,
  by.x = "ResponseId",
  by.y = "ResponseId.pre", 
  suffixes = c(".daily", ".pre"),
  all = F
)

# merge daily with post
dfCombined <- merge(
  x = dfPreDaily,
  y = df.post,
  by.x = "ResponseId",
  by.y = "ResponseId.post", 
  suffixes = c(".pre", ".post"),
  all = F
)

# add to list
dtS3$clean <- dfCombined

# clean up workspace
rm(df.pre, df.daily, df.post, dfPreDaily, dfCombined, ownIDs)

Calculate needed transformations

Worker

For the worker sample, the data transformation stage had three main aims:

  1. We first corrected time indicators within the surveys. In some cases participants completed their daily diary surveys for the afternoon after midnight. In these cases the measurement still is in reference to the previous day and is indicated in the corrected variable.
  2. We then created indices of scales. Some indices were multi-item scales while some indices combine equivalent measurement for different situational circumstances (e.g., competence perceptions after interactions and at measurement occasions without interactions).
  3. Finally, we calculated several basic participant summaries (averages across all measurement occasions).
df <- dtS1$clean

# Time and Date Variables
# remove seconds from afternoon time
df$SubTime[df$daytime == "afternoon"] <- paste0(substring(as.character(df$time.0[df$daytime == "afternoon"]), 4, 8), ":00")
df$time.daily[df$daytime == "afternoon" &
  !is.na(df$time.daily != "<NA>")] <- paste0(substring(as.character(df$time.daily[df$daytime == "afternoon" &
  !is.na(df$time.daily != "<NA>")]), 4, 8), ":00")

# Correct morning / afternoon date where survey was collected the day after to indicate the correct date that was targeted
df$PPDate[df$SubTime < "11:50:00" &
  df$daytime == "morning"] <- df$PPDate[df$SubTime < "11:50:00" &
  df$daytime == "morning"] - 1
df$PPDate[df$SubTime < "18:50:00" &
  df$daytime == "afternoon"] <- df$PPDate[df$SubTime < "18:50:00" &
  df$daytime == "afternoon"] - 1

# Make time IDs consistent with later studies
df$TID <- paste(df$PPDate, str_to_title(df$daytime))
df$TIDnum <- as.numeric(factor(df$TID %>% gsub(" Morning", "-A", .) %>% gsub(" Afternoon", "-B", .)))

df <- df %>%
  rowwise() %>%
  mutate(
    InteractionDum = sum(IntergroupContact, IngroupContact, na.rm = FALSE),
    InteractionDum = if_else(InteractionDum > 0, 1, InteractionDum),
    alertness = sum(alertness1, alertness2, na.rm = TRUE),
    calmness = sum(calmness1, calmness2, na.rm = TRUE),
    valence = sum(valence1, valence2, na.rm = TRUE)
  ) %>%
  ungroup()

# Need scales
df$keyMotiveFulfilled <- rowSums(df[, c("KeyNeedFulfillment", "DaytimeNeedFulfillment")], na.rm = T)
df$autonomy.daily.all <- rowSums(df[, c("autonomy_Int", "autonomy_NoInt")], na.rm = T)
df$competence.daily.all <- rowSums(df[, c("competence_Int", "competence_NoInt")], na.rm = T)
# cor(df$relatednessOther, df$relatedness_self_1,use="complete.obs")
df$relatedness.daily.all <- rowMeans(df[, c(
  "relatednessOther",
  "relatednessSelf",
  "relatednessNoInteraction"
)], na.rm = T)

pairs.panels.new(
  df[c("relatednessSelf", "relatednessOther")],
  labels = c(
    "I shared information about myself.",
    "X shared information about themselves."
  )
)

df$relatedness <- rowMeans(df[, c("relatednessOther", "relatednessSelf")], na.rm = T)

df$autonomy <- df$autonomy.daily.all
df$competence <- df$competence.daily.all
df$relatedness <- df$relatedness.daily.all

# summarize by participant (check that everything is within pp might not be the case for )
between <- df %>%
  group_by(last_outside_referrer) %>%
  mutate(
    CtContactNL = sum(IntergroupContact),
    CtContactNonNl = sum(IngroupContact),
    CtContactNLAll = sum(ContactNum),
    CtContactNonNlAll = sum(NonDutchNum),
    AvKeyNeed = mean(keyMotiveFulfilled, na.rm = T),
    AvKeyNeedInt = mean(KeyNeedFulfillment, na.rm = T),
    AvKeyNeedNoInt = mean(DaytimeNeedFulfillment, na.rm = T),
    AvAutonomy = mean(autonomy, na.rm = T),
    AvCompetence = mean(competence, na.rm = T),
    AvRelatedness = mean(relatedness, na.rm = T),
    AvThermo = mean(AttitudesDutch, na.rm = T),
    AvWB = mean(exWB, na.rm = T)
  ) %>%
  ungroup() %>%
  mutate(
    CtContactNL_c = scale(CtContactNL, scale = FALSE),
    AvKeyNeedInt_c = scale(AvKeyNeedInt, scale = FALSE),
    AvKeyNeed_c = scale(AvKeyNeed, scale = FALSE),
    CtContactNL_z = scale(CtContactNL, scale = TRUE),
    AvKeyNeedInt_z = scale(AvKeyNeedInt, scale = TRUE),
    AvKeyNeed_z = scale(AvKeyNeed, scale = TRUE)
  )

warning(
  "some variable transformations (esp. _c and _z) might be across all participants (i.e., not within PP). See next step."
)

dtS1$full <- between
rm(df, between)

# dataframe where interaction types are recoded
workerInteractionType <- dtS1$full %>%
  mutate(
    OutgroupInteraction = as_factor(IntergroupContact),
    NonOutgroupInteraction = as_factor(IngroupContact)
  )

# Create variables centered and standardized within Participant
# i.e., divide into trait and state
workerWithinBetween <-
  MlTraitState(
    data = workerInteractionType,
    id = "PID",
    selection =
      c(
        "keyMotiveFulfilled",
        "competence",
        "autonomy",
        "relatedness",
        "AttitudesDutch",
        "KeyNeedFulfillment",
        "competence",
        "autonomy",
        "relatednessNoInteraction", 
        "qualityOverall", 
        "OutgroupInteraction",
        "NonOutgroupInteraction"
      )
  )

workerOutWithinBetween <-
  MlTraitState(
    data = workerInteractionType %>% filter(OutgroupInteraction == "Yes"),
    id = "PID",
    selection =
      c(
        "keyMotiveFulfilled",
        "AttitudesDutch",
        "KeyNeedFulfillment",
        "competence",
        "autonomy",
        "relatedness", 
        "qualityOverall"
      )
  )


# Between participants contact frequency
workerContactFreq <- dtS1$full %>%
  group_by(PID) %>%
  summarise(
    n = n(),
    SumContactNL = sum(IntergroupContact),
    PercContactNL = SumContactNL / n * 100,
    SumContactNLAll = sum(number),
    AvAttitude = mean(AttitudesDutch, na.rm = T)
  ) %>%
  mutate(
    WinSumContactNL = DescTools::Winsorize(SumContactNL),
    WinSumContactNLAll = DescTools::Winsorize(SumContactNLAll)
  )

# save cleaned data
# save(df.btw, file = "data/processed/df.btw.RData")
# write_sav(df.btw, "data/processed/MT_clean-merged_pre-post.sav")

# export data to Mplus
# df.mplus = remove_all_labels(select(df,
#                                     PID, ResponseId,
#                                     thermometerDutch_1, inNonDutch, Contact_dum,
#                                     keyMotiveFulfilled, autonomy.daily.all, competence.daily.all, relatedness.daily.all))
# names(df.mplus)= c("PID", "ResponseId", "att", "intin", "intout", "keymot", "aut", "comp", "rel")
# mplus = df.mplus[order(df.mplus$PID, df.mplus$ResponseId),]
# mplus.intcont = mplus[mplus$intout==1,]
# prepareMplusData(mplus.intcont, "data/processed/dynamic-subset-intonly.dat")

Student

For the student sample, the data transformation stage had five main aims:

  1. We first create person, survey type, and measurement ID variables.
  2. We then created indices of scales. Some indices were multi-item scales while some indices combine equivalent measurement for different situational circumstances (e.g., competence perceptions after interactions and at measurement occasions without interactions).
  3. We add information about the interaction partner to the beep during which a person was selected as an interaction partner.
  4. We cluster mean-center key variables within participants.
  5. Finally, we calculated several basic participant summaries (averages across all measurement occasions).
df <- dtS2$clean

# Add ID variables
df$PID <- as.numeric(factor(df$ResponseId)) # participant ID

# order time
df$TID <- factor(df$date_period, levels = unique(dtS2$raw.daily$date_period))
df$TIDnum <- as.numeric(df$TID) # get numeric TID

# check whether time ordering worked
df <- df %>%
  arrange(PID, TID) # %>%
# View()

# Interaction as Factor
df$interaction.f <-
  factor(df$Interaction,
    levels = c("no interaction", "Dutch", "Non-Dutch")
  )
df$intNL <- ifelse(df$Interaction == "Dutch", 1, 0)
df$intNonNL <- ifelse(df$Interaction == "Non-Dutch", 1, 0)

df$IntergroupContact <- (df$IntergroupContact-2)*-1

# -------------------------------------------------------------------------------------------------------------
#                                       Combine Variables
# -------------------------------------------------------------------------------------------------------------
# Relatedness
pairs.panels.new(
  df[c("relatednessSelf", "relatednessOther")],
  labels = c(
    "I shared information about myself.",
    "X shared information about themselves."
  )
)

df$relatednessInteraction <- rowMeans(df[c("relatednessSelf", "relatednessOther")], na.rm = TRUE)
df$relatednessInteraction[df$relatednessInteraction == "NaN"] <- NA
# Relatedness Overall (JANNIS NOT SURE THESE ARE CORRECT, CHANGE ROWS?; J: Changed "NaN" in df$RelatednessInteraction to NA() should work now)
df$relatedness <-
  rowMeans(df[, c("relatednessInteraction", "relatednessNoInteraction")],
           na.rm = TRUE) %>%
  ifelse(is.nan(.), NA, .)

# Core Need
df$DaytimeNeedFulfillment[df$InteractionDum == 0 & !is.na(df$KeyNeedFulfillment)] <-
  df$KeyNeedFulfillment[df$InteractionDum == 0 & !is.na(df$KeyNeedFulfillment)]

df$InteractionNeedFullfillment <- NA 
df$InteractionNeedFullfillment[df$InteractionDum == 1 & !is.na(df$KeyNeedFulfillment)] <- 
  df$KeyNeedFulfillment[df$InteractionDum == 1 & !is.na(df$KeyNeedFulfillment)]


# Pro-Sociality
df$ProSo <-
  rowMeans(df[, c("ProSo1", "ProSo2", "ProSo3", "ProSo4")], na.rm = T)
# Anti-Sociality
df$AntiSo <-
  rowMeans(df[, c("AntiSo1", "AntiSo2", "AntiSo3", "AntiSo4")], na.rm = T)


# -------------------------------------------------------------------------------------------------------------
#                                 Add Variables related to interaction partner
# -------------------------------------------------------------------------------------------------------------
# create function for later lapply
createIntPartDf <- function(inp) {
  # prepare the dataframe so that we can forloop over it later
  tmp <- data.frame(
    CC = as.character(inp$CC),
    NewCC = as.character(inp$NewCC),
    NewName = as.character(inp$NewName),
    NewCloseness = inp$NewCloseness,
    NewGender = inp$NewGender,
    NewEthnicity = as.character(inp$NewEthnicity),
    NewRelationship = as.character(inp$NewRelationship)
  )

  tmp$CC2 <- recode(tmp$CC, "SOMEONE ELSE" = "NA")
  tmp$CC2 <-
    ifelse(
      tmp$CC == 1 |
        tmp$CC == "SOMEONE ELSE",
      as.character(tmp$NewName),
      as.character(tmp$CC2)
    )
  # maybe add [[:space:]]\b to remove space before word boundary or ^[[:space:]] to remove space in the beginning of a string
  tmp$CC2 <- gsub("^[[:space:]]", "", tmp$CC2)
  tmp$NewName <- gsub("^[[:space:]]", "", tmp$NewName)

  # open the variables that will be filled up in the foor-loop
  tmp$closeness <- rep(NA, nrow(tmp))
  tmp$gender <- rep(NA, nrow(tmp))
  tmp$ethnicity <- rep(NA, nrow(tmp))
  tmp$relationship <- rep(NA, nrow(tmp))

  # Run the for-loop. It finds the variables related to the name of the interaction partner. If there is a repeating interaction
  # partner (i.e. CC2) it takes the value (i.e. NewCloseness) from the first interaction (i.e. NewName)
  for (i in 1:nrow(tmp)) {
    if (is.na(tmp$CC2[i])) {
      next
    } else {
      tmp$closeness[i] <-
        na.omit(tmp$NewCloseness[as.character(tmp$CC2[i]) == as.character(tmp$NewName)])[1] # find closeness where CC2 matches NewName (na.omit + [1] to get the number)
      tmp$gender[i] <-
        na.omit(tmp$NewGender[as.character(tmp$CC2[i]) == as.character(tmp$NewName)])[1] # (na.omit + [1] to get the number and not the rest of the na.omit list)
      tmp$ethnicity[i] <-
        na.omit(as.character(tmp$NewEthnicity[as.character(tmp$CC2[i]) == as.character(tmp$NewName)]))[1] # PROBLEM IS THAT THERE ARE TOO MANY NA's: Difficult to deal with
      tmp$relationship[i] <-
        na.omit(as.character(tmp$NewRelationship[as.character(tmp$CC2[i]) == as.character(tmp$NewName)]))[1]
    }
  }

  out <- tmp
  out
}

# split df per participants and run function
PP <- split(df, df$PID)
PP <- lapply(PP, createIntPartDf)
rm(createIntPartDf)

# add variables back to df
remergePP <- do.call(rbind.data.frame, PP)
colnames(remergePP) <-
  paste(colnames(remergePP), "_Calc", sep = "")
df <- cbind(df, remergePP)
rm(remergePP, PP)

# -------------------------------------------------------------------------------------------------------------
#                                 Center Relevant Variables
# -------------------------------------------------------------------------------------------------------------

df <- df %>%
  group_by(PID) %>%
  mutate(
    KeyNeedFulfillment.cm = mean(KeyNeedFulfillment, na.rm = TRUE),
    # cluster mean (mean of PP)
    KeyNeedFulfillment.cwc = KeyNeedFulfillment - KeyNeedFulfillment.cm,
    # cluster mean centered (within PP centered)
    closeness.cm = mean(closeness_Calc, na.rm = TRUE),
    closeness.cwc = closeness_Calc - closeness.cm
  ) %>%
  ungroup()

# store
dtS2$full <- df
rm(df)

# Between participants contact frequency
studentContactFreq <- dtS2$full %>%
  group_by(PID) %>%
  summarise(
    n = n(),
    SumContactNL = sum(InteractionDumDutch),
    PercContactNL = SumContactNL / n * 100,
    SumContactNLAll = sum(ContactNum[InteractionDumDutch == 1], na.rm = TRUE),
    AvAttitude = mean(AttitudesDutch, na.rm = TRUE),
    AvQuality = mean(qualityOverall, na.rm = TRUE)
  ) %>%
  mutate(
    WinSumContactNL = DescTools::Winsorize(SumContactNL),
    WinSumContactNLAll = DescTools::Winsorize(SumContactNLAll)
  )

# dataframe where interaction types are recoded
studentInteractionType <- dtS2$full %>%
  mutate(
    NonDutchContact = tidyr::replace_na(NonDutchContact, 2), # make second non-Dutch countable
    NonDutchContact = NonDutchContact*-1+2 # recode (yes = 1 -> 1, no = 2 -> 0)
  ) %>%
  mutate(
    NonDutchNum = ifelse(NonDutchContact == 0, 0, NonDutchNum), # measurement error --- only measured when NonDutchContact==1
    OutgroupInteraction = factor(
      InteractionDumDutch,
      levels = c(0, 1),
      labels = c("No", "Yes")
    ),
    NonOutgroupInteraction = factor(
      rowSums(select(., c(InteractionDumNonDutch, NonDutchContact))), # combine the two non-Dutch Q.,
      levels = c(0, 1),
      labels = c("No", "Yes")
    )
  )

# select a subset of IDs to display in plots
studentPltIDs <-
  studentInteractionType %>%
  group_by(PID) %>%
  summarise(n = n()) %>%
  slice_max(n, n = 20) %>% # chose the 20 with the most number of measurements
  select(PID) %>%
  as.matrix %>%
  as.vector

# select a subset of IDs to display in plots (only outgroup interactions)
studentOutPltIDs <-
  studentInteractionType %>%
  filter(OutgroupInteraction == "Yes") %>%
  group_by(PID) %>%
  summarise(n = n()) %>%
  slice_max(n, n = 20) %>% # chose the 20 with the most number of measurements
  select(PID) %>%
  as.matrix %>%
  as.vector

# Center within and between
# divide into trait and state
studentWithinBetween <-
  MlTraitState(
    data = studentInteractionType,
    id = "PID",
    selection =
      c(
        "KeyNeedFulfillment",
        "competence",
        "autonomy",
        "relatedness",
        "AttitudesDutch",
        "qualityOverall",
        "OutgroupInteraction",
        "NonOutgroupInteraction"
      )
  )
studentOutWithinBetween <-
  MlTraitState(
    data = studentInteractionType %>% filter(OutgroupInteraction == "Yes"),
    id = "PID",
    selection =
      c(
        "KeyNeedFulfillment",
        "competence",
        "autonomy",
        "relatedness",
        "AttitudesDutch",
        "qualityOverall"
      )
  )

Medical

For the medical professional sample, the data transformation stage had five main aims:

  1. We first create person, survey type, and measurement ID variables.
  2. We then created indices of scales. Some indices were multi-item scales while some indices combine equivalent measurement for different situational circumstances (e.g., competence perceptions after interactions and at measurement occasions without interactions).
  3. We cluster mean-center key variables within participants.
  4. Finally, we calculated several basic participant summaries (averages across all measurement occasions).
df <- dtS3$clean

# Add ID variables
df$PID <- as.numeric(factor(df$ResponseId)) # participant ID

# order time
df$TID <-
  factor(df$date_period, levels = unique(dtS3$raw.daily$date_period))
df$TIDnum <- as.numeric(df$TID) # get numeric TID

# check whether time ordering worked
df <- df %>%
  arrange(PID, TID) # %>%
# View()

# Interaction as Factor
df$interaction.f <-
  factor(df$Interaction,
    levels = c("no interaction", "Dutch", "Non-Dutch")
  )
df$intNL <- ifelse(df$Interaction == "Dutch", 1, 0)
df$intNonNL <- ifelse(df$Interaction == "Non-Dutch", 1, 0)

df <- df %>%
  mutate(
    NonDutchContact = replace_na(NonDutchNum, 0), # make second non-Dutch countable
    NonDutchContact = ifelse(NonDutchContact > 1, 1, 0) # recode (yes = 1 -> 1, no = 2 -> 0)
  ) %>%
  mutate(
    OutgroupInteraction = factor(
      InteractionDumDutch,
      levels = c(0, 1),
      labels = c("No", "Yes")
    ),
    NonOutgroupInteraction = factor(
      rowSums(select(., c(InteractionDumNonDutch, NonDutchContact)), na.rm = TRUE), # combine the two non-Dutch Q.,
      levels = c(0, 1),
      labels = c("No", "Yes")
    )
  )

df$IntergroupContact <- (df$IntergroupContact-2)*-1


# -------------------------------------------------------------------------------------------------------------
#                                       Combine Variables
# -------------------------------------------------------------------------------------------------------------
# Relatedness
pairs.panels.new(
  df[c("relatednessSelf", "relatednessOther")],
  labels = c(
    "I shared information about myself.",
    "X shared information about themselves."
  )
)

df$relatednessInteraction <-
  rowMeans(df[c("relatednessSelf", "relatednessOther")], na.rm = TRUE)
df$relatednessInteraction[df$relatednessInteraction == "NaN"] <- NA
# Relatedness Overall (JANNIS NOT SURE THESE ARE CORRECT, CHANGE ROWS?; J: Changed "NaN" in df$RelatednessInteraction to NA() should work now)
df$relatedness <-
  rowMeans(df[, c("relatednessInteraction", "relatednessNoInteraction")],
           na.rm = TRUE) %>%
  ifelse(is.nan(.), NA, .)


df$DaytimeNeedFulfillment[df$InteractionDum == 0 & !is.na(df$KeyNeedFulfillment)] <-
  df$KeyNeedFulfillment[df$InteractionDum == 0 & !is.na(df$KeyNeedFulfillment)]

df$InteractionNeedFullfillment <- NA 
df$InteractionNeedFullfillment[df$InteractionDum == 1 & !is.na(df$KeyNeedFulfillment)] <- 
  df$KeyNeedFulfillment[df$InteractionDum == 1 & !is.na(df$KeyNeedFulfillment)]

df$InteractionNeedImportance <- NA 
df$InteractionNeedImportance[df$InteractionDum == 1 & !is.na(df$KeyNeedImp)] <- 
  df$KeyNeedImp[df$InteractionDum == 1 & !is.na(df$KeyNeedImp)]


# Pro-Sociality
df$ProSo <-
  rowMeans(df[, c("ProSo1", "ProSo2", "ProSo3", "ProSo4")], na.rm = TRUE)
# Anti-Sociality
df$AntiSo <-
  rowMeans(df[, c("AntiSo1", "AntiSo2", "AntiSo3", "AntiSo4")], na.rm = TRUE)

# Allport's Conditions
df %>%
  #filter(OutgroupInteraction == "Yes") %>%
  select(
    InteractionContextEqualStatus,
    KeyNeedShared,
    InteractionContextCooperative,
    InteractionContextvoluntary
  ) %>%
  pairs.panels.new

df %>%
  #filter(OutgroupInteraction == "Yes") %>%
  select(
    InteractionContextEqualStatus,
    KeyNeedShared,
    InteractionContextCooperative,
    InteractionContextvoluntary
  ) %>%
  psych::describe(., skew=F,ranges=T) %>%
  as.data.frame() %>%
  select(-vars) %>%
  kable(., caption = "Descriptives of Allport's Condition items") %>% 
  kable_styling("hover", full_width = F, latex_options = "hold_position")
Table 1: Descriptives of Allport’s Condition items
n mean sd min max range se
InteractionContextEqualStatus 3099 81.84 23.58 0 100 100 0.4236
KeyNeedShared 3110 84.90 18.74 0 100 100 0.3360
InteractionContextCooperative 3099 85.67 18.35 0 100 100 0.3296
InteractionContextvoluntary 3099 84.14 22.28 0 100 100 0.4002
iaWorkerAllport <- 
  df %>%
  #filter(OutgroupInteraction == "Yes") %>%
  select(
    InteractionContextEqualStatus,
    KeyNeedShared,
    InteractionContextCooperative,
    InteractionContextvoluntary
  )

sjPlot::tab_itemscale(iaWorkerAllport)
Component 1
Missings Mean SD Skew Item Difficulty Item Discrimination α if deleted
24.54 % 81.84 23.58 -1.43 0.82 0.52 0.64
24.28 % 84.9 18.74 -1.78 0.85 0.42 0.69
24.54 % 85.67 18.35 -1.55 0.86 0.60 0.59
24.54 % 84.14 22.28 -1.7 0.84 0.47 0.67
Mean inter-item-correlation=0.386 · Cronbach’s α=0.709
pca <- parameters::principal_components(iaWorkerAllport)
factor.groups <- parameters::closest_component(pca)

sjPlot::tab_itemscale(iaWorkerAllport, factor.groups)
Component 1
Missings Mean SD Skew Item Difficulty Item Discrimination α if deleted
24.54 % 81.84 23.58 -1.43 0.82 0.52 0.64
24.28 % 84.9 18.74 -1.78 0.85 0.42 0.69
24.54 % 85.67 18.35 -1.55 0.86 0.60 0.59
24.54 % 84.14 22.28 -1.7 0.84 0.47 0.67
Mean inter-item-correlation=0.386 · Cronbach’s α=0.709
ltm::cronbach.alpha(na.omit(iaWorkerAllport), CI = TRUE)
## 
## Cronbach's alpha for the 'na.omit(iaWorkerAllport)' data-set
## 
## Items: 4
## Sample units: 3099
## alpha: 0.709
## 
## Bootstrap 95% CI based on 1000 samples
##  2.5% 97.5% 
## 0.688 0.730
data <- 
  df %>%
  select(
    PID,
    TIDnum,
    InteractionContextEqualStatus,
    KeyNeedShared,
    InteractionContextCooperative,
    InteractionContextvoluntary
  ) %>%
  drop_na %>%
  melt(
    ., 
    id.vars = c("PID", "TIDnum")
  )


horst::nestedAlpha(item.level.1 = "value",
                   level.2      = "TIDnum",
                   level.3      = "PID",
                   data         = data)
##  alpha 
## 0.7829
rm(data)

iaWorkerAllportScale <- 
  iaWorkerAllport %>%
  Scale::Scale() %>%
  Scale::ItemAnalysis()

df$AllportsCondition <-
  scoreItems(
    keys = c(1, 1, 1, 1),
    items = df %>% select(
      InteractionContextEqualStatus,
      KeyNeedShared,
      InteractionContextCooperative,
      InteractionContextvoluntary
    ),
    min = 0,
    max = 100
  )$scores

as.data.frame(psych::describe(df$AllportsCondition, skew=T)) %>%
  mutate(vars = "Allport's Conditions Index") %>%
  kable(., caption = "Allport's Conditions: Scale Descriptives", row.names = FALSE) %>% 
  kable_styling("hover", full_width = F, latex_options = "hold_position")
Table 1: Allport’s Conditions: Scale Descriptives
vars n mean sd median trimmed mad min max range skew kurtosis se
Allport’s Conditions Index 4107 86.49 13.88 93.75 88.6 9.266 0 100 100 -1.454 2.406 0.2165
ggplot(df, aes(x = AllportsCondition)) +
  geom_histogram() +
  theme_Publication()

# -------------------------------------------------------------------------------------------------------------
#                                 Add Variables related to interaction partner
# -------------------------------------------------------------------------------------------------------------
# create function for later lapply
createIntPartDf <- function(inp) {
  # prepare the dataframe so that we can forloop over it later
  tmp <- data.frame(
    CC = as.character(inp$CC),
    NewCC = as.character(inp$NewCC),
    NewName = as.character(inp$NewName),
    NewCloseness = inp$NewCloseness,
    NewGender = inp$NewGender,
    NewEthnicity = as.character(inp$NewEthnicity),
    NewRelationship = as.character(inp$NewRelationship)
  )

  tmp$CC2 <- recode(tmp$CC, "SOMEONE ELSE" = "NA")
  tmp$CC2 <-
    ifelse(
      tmp$CC == 1 |
        tmp$CC == "SOMEONE ELSE",
      as.character(tmp$NewName),
      as.character(tmp$CC2)
    )
  # maybe add [[:space:]]\b to remove space before word boundary or ^[[:space:]] to remove space in the beginning of a string
  tmp$CC2 <- gsub("^[[:space:]]", "", tmp$CC2)
  tmp$NewName <- gsub("^[[:space:]]", "", tmp$NewName)

  # open the variables that will be filled up in the foor-loop
  tmp$closeness <- rep(NA, nrow(tmp))
  tmp$gender <- rep(NA, nrow(tmp))
  tmp$ethnicity <- rep(NA, nrow(tmp))
  tmp$relationship <- rep(NA, nrow(tmp))

  # Run the for-loop. It finds the variables related to the name of the interaction partner. If there is a repeating interaction
  # partner (i.e. CC2) it takes the value (i.e. NewCloseness) from the first interaction (i.e. NewName)
  for (i in 1:nrow(tmp)) {
    if (is.na(tmp$CC2[i])) {
      next
    } else {
      tmp$closeness[i] <-
        na.omit(tmp$NewCloseness[as.character(tmp$CC2[i]) == as.character(tmp$NewName)])[1] # find closeness where CC2 matches NewName (na.omit + [1] to get the number)
      tmp$gender[i] <-
        na.omit(tmp$NewGender[as.character(tmp$CC2[i]) == as.character(tmp$NewName)])[1] # (na.omit + [1] to get the number and not the rest of the na.omit list)
      tmp$ethnicity[i] <-
        na.omit(as.character(tmp$NewEthnicity[as.character(tmp$CC2[i]) == as.character(tmp$NewName)]))[1] # PROBLEM IS THAT THERE ARE TOO MANY NA's: Difficult to deal with
      tmp$relationship[i] <-
        na.omit(as.character(tmp$NewRelationship[as.character(tmp$CC2[i]) == as.character(tmp$NewName)]))[1]
    }
  }

  out <- tmp
  out
}

# split df per participants and run function
PP <- split(df, df$PID)
PP <- lapply(PP, createIntPartDf)
rm(createIntPartDf)

# add variables back to df
remergePP <- do.call(rbind.data.frame, PP)
colnames(remergePP) <-
  paste(colnames(remergePP), "_Calc", sep = "")
df <- cbind(df, remergePP)
rm(remergePP, PP)

# -------------------------------------------------------------------------------------------------------------
#                                 Center Relevant Variables
# -------------------------------------------------------------------------------------------------------------
# divide into trait and state
medicalOutWithinBetween <-
  MlTraitState(
    data = df %>% filter(OutgroupInteraction == "Yes"),
    id = "PID",
    selection =
      c(
        "KeyNeedFulfillment",
        "competence",
        "autonomy",
        "relatedness",
        "AllportsCondition",
        "AttitudesDutch",
        "qualityOverall"
      )
  )

medicalWithinBetween <-
  MlTraitState(
    data = df,
    id = "PID",
    selection =
      c(
        "KeyNeedFulfillment",
        "competence",
        "autonomy",
        "relatedness",
        "AllportsCondition",
        "AttitudesDutch",
        "qualityOverall",
        "OutgroupInteraction",
        "NonOutgroupInteraction"
      )
  )

df <- # keep only for compatibility of old framgents
  MlTraitState(
    data = df,
    id = "PID",
    selection =
      c(
        "KeyNeedFulfillment",
        "competence",
        "autonomy",
        "relatedness",
        "AllportsCondition",
        "AttitudesDutch",
        "qualityOverall"
      )
  )

# store
dtS3$full <- df
rm(df)


# Between participants contact frequency
medicalContactFreq <- 
  dtS3$full %>%
  group_by(PID) %>%
  summarise(
    n = n(),
    SumContactNL = sum(InteractionDumDutch, na.rm = TRUE),
    PercContactNL = SumContactNL / n * 100,
    SumContactNLAll = sum(ContactNum[InteractionDumDutch == 1], na.rm = TRUE),
    AvAttitude = mean(AttitudesDutch, na.rm = TRUE),
    AvQuality = mean(qualityOverall, na.rm = TRUE)
  ) %>%
  mutate(
    WinSumContactNL = DescTools::Winsorize(SumContactNL),
    WinSumContactNLAll = DescTools::Winsorize(SumContactNLAll)
  )

# select a subset of IDs to display in plots
medicalPltIDs <-
  dtS3$full %>%
  group_by(PID) %>%
  summarise(n = n()) %>%
  slice_max(n, n = 20) %>% # chose the 20 with the most number of measurements
  select(PID) %>%
  as.matrix %>%
  as.vector

# select a subset of IDs to display in plots (only outgroup interactions)
medicalOutPltIDs <-
  dtS3$full %>%
  filter(OutgroupInteraction == "Yes") %>%
  group_by(PID) %>%
  summarise(n = n()) %>%
  slice_max(n, n = 20) %>% # chose the 20 with the most number of measurements
  select(PID) %>%
  as.matrix %>%
  as.vector

Data Availability and Sample Selection

As one of our main analyses is a three-mode principal component analysis (3MPCA) we begin by assessing the amount of missing data in each of the ESM studies. To assess the missingness in detail, we prepare a data availability table of whether data is available or missing for each possible measurement point (data + morning/afternoon) for all individual participants. We then export the data availability tables as comma separated value files (.csv) to be assessed in detail using a spreadsheet program (such as MS Excel).

Study 1

dtS1Availability <- dtS1$full %>%
  select(
    PID,
    TIDnum
  ) %>%
  arrange(PID, TIDnum) %>%
  mutate(data = 1)
dtS1Availability <- reshape::cast(dtS1Availability, PID ~ TIDnum) %>%
  select(-PID) %>%
  mutate_all(function(x) ifelse(x>1,1,x))
# sum(colMeans(dtS1Availability)*100 >= 66)
# sum(rowMeans(dtS1Availability)*100 >= 66)
# sum(colMeans(dtS1Availability[-5,])*100 >= 66)
# sum(rowMeans(dtS1Availability[,-8])*100 >= 66)

rownames(dtS1Availability) <- paste("PP", 1:nrow(dtS1Availability), sep = "_")
colnames(dtS1Availability) <- paste("t", 1:ncol(dtS1Availability), sep = "_")
dtS1AvailabilityKbl <- dtS1Availability

dtS1AvailabilityKbl[1:ncol(dtS1AvailabilityKbl)] <- lapply(dtS1AvailabilityKbl[1:ncol(dtS1AvailabilityKbl)], function(x) {
    cell_spec(x,
              bold = FALSE,
              color = "white",
              background = ifelse(x == 1, "green", "red")
              )
})
kbl(
  dtS1AvailabilityKbl,
  format = "html",
  escape = FALSE,
  align = "c",
  booktabs = TRUE,
  caption = "Study 1: Data Availability" # complete caption for main document
) %>%
  kable_classic(
    full_width = FALSE,
    lightable_options = "hover",
    html_font = "Cambria"
  ) %>%
  scroll_box(width = "100%", height = "500px")
Table 2: Study 1: Data Availability
t_1 t_2 t_3 t_4 t_5 t_6 t_7 t_8 t_9 t_10 t_11 t_12 t_13 t_14 t_15 t_16 t_17 t_18 t_19 t_20 t_21 t_22 t_23 t_24 t_25 t_26 t_27 t_28 t_29 t_30 t_31 t_32 t_33 t_34 t_35 t_36 t_37 t_38 t_39 t_40 t_41 t_42 t_43 t_44 t_45 t_46 t_47 t_48 t_49 t_50 t_51 t_52 t_53 t_54 t_55 t_56 t_57 t_58 t_59 t_60 t_61 t_62 t_63
PP_1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1
PP_2 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
PP_3 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0
PP_4 0 0 0 0 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 1 1 1 0 0 0 1 1 0 0 0 0 0 0 0
PP_5 0 1 1 1 1 1 1 1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0 0 0 0 0 0 0 0 0 0 0 0 0 0
PP_21 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
PP_22 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PP_23 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1
write.csv(dtS1Availability, "data/S1_Workers/processed/workerAvailability.csv")
cleanM <- function(M, c = 66) {
  check <- list()
  rowNamesOut <- c()
  colNamesOut <- c()
  for (i in 1:length(c(row.names(M), names(M)))) {
    rowMeans <- rowMeans(M) * 100
    colMeans <- colMeans(M) * 100
    rcMeans <- c(rowMeans, colMeans)
    rm <- which.min(rcMeans) %>% names
    rc <- ifelse(startsWith(rm, "PP_"), "row", "col")
    
    check[[i]] <- rcMeans
    
    if (!all(rcMeans >= c) && rc == "row") {
      M <- M[!(row.names(M) %in% rm), ]
      rowNamesOut <- append(rowNamesOut, rm)
      cat(i, ": Row ", rm, " had a completion rate of ", format(round(min(rcMeans), 2), nsmall = 2), "% and was removed.\n", sep = "")
    } else if (!all(rcMeans >= c) && rc == "col") {
      M <- M[, !(names(M) %in% rm)]
      colNamesOut <- append(colNamesOut, rm)
      cat(i, ": Column ", rm, " had a completion rate of ", format(round(min(rcMeans), 2), nsmall = 2), "% and was removed.\n", sep = "")
    } else {
      cat(i, ": All row- and column means are over ", c, "%. The final matrix has ", nrow(M), " rows and ", ncol(M), " columns.", sep = "")
      return(
        list(
          reducedMatrix = M,
          rowNamesIn = row.names(M),
          colNamesIn = names(M),
          rowNamesOut = rowNamesOut,
          colNamesOut = colNamesOut,
          rowMeans = rowMeans,
          colMeans = colMeans
        )
      )
    }
  }
}

dtS1RedInfo <- cleanM(M = as.data.frame(dtS1Availability), c = 66)
## 1: Row PP_20 had a completion rate of 3.17% and was removed.
## 2: Row PP_22 had a completion rate of 4.76% and was removed.
## 3: Column t_1 had a completion rate of 23.81% and was removed.
## 4: Column t_2 had a completion rate of 52.38% and was removed.
## 5: Column t_4 had a completion rate of 61.90% and was removed.
## 6: All row- and column means are over 66%. The final matrix has 21 rows and 60 columns.
PIDout <- gsub("PP_", "", dtS1RedInfo$rowNamesOut) %>% as.numeric
TIDout <- gsub("t_", "", dtS1RedInfo$colNamesOut) %>% as.numeric

dtS1Red <- dtS1$full %>%
  filter(
    !PID %in% PIDout,
    !TIDnum %in% TIDout
  ) %>%
  mutate(TIDnum = as.numeric(factor(TIDnum)))
rm(PIDout, TIDout)

dtS1AvailabilityRedKbl <- dtS1RedInfo$reducedMatrix
dtS1AvailabilityRedKbl[1:ncol(dtS1AvailabilityRedKbl)] <- lapply(dtS1AvailabilityRedKbl[1:ncol(dtS1AvailabilityRedKbl)], function(x) {
    cell_spec(x,
              bold = FALSE,
              color = "white",
              background = ifelse(x == 1, "green", "red")
              )
})
kbl(
  dtS1AvailabilityRedKbl,
  format = "html",
  escape = FALSE,
  align = "c",
  booktabs = TRUE,
  caption = "Study 1: FinalData Availability" # complete caption for main document
) %>%
  kable_classic(
    full_width = FALSE,
    lightable_options = "hover",
    html_font = "Cambria"
  ) %>%
  scroll_box(width = "100%", height = "500px")
Table 3: Study 1: FinalData Availability
t_3 t_5 t_6 t_7 t_8 t_9 t_10 t_11 t_12 t_13 t_14 t_15 t_16 t_17 t_18 t_19 t_20 t_21 t_22 t_23 t_24 t_25 t_26 t_27 t_28 t_29 t_30 t_31 t_32 t_33 t_34 t_35 t_36 t_37 t_38 t_39 t_40 t_41 t_42 t_43 t_44 t_45 t_46 t_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1 1 1 1 0 1 1 1 1
PP_17 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
PP_18 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
PP_19 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
PP_21 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
PP_23 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1

Study 2

dtS2Availability <- dtS2$full %>%
  select(
    PID,
    TIDnum
  ) %>%
  arrange(PID, TIDnum) %>%
  mutate(data = 1)
dtS2Availability <- reshape::cast(dtS2Availability, PID ~ TIDnum) %>%
  select(-PID)

rownames(dtS2Availability) <- paste("PP", 1:nrow(dtS2Availability), sep = "_")
colnames(dtS2Availability) <- paste("t", 1:ncol(dtS2Availability), sep = "_")

write.csv(dtS2Availability, "data/S2_Students/processed/studentAvailability.csv")

dtS2AvailabilityKbl <- dtS2Availability
dtS2AvailabilityKbl[1:ncol(dtS2AvailabilityKbl)] <- lapply(dtS2AvailabilityKbl[1:ncol(dtS2AvailabilityKbl)], function(x) {
    cell_spec(x,
              bold = FALSE,
              color = "white",
              background = ifelse(x == 1, "green", "red")
              )
})
kbl(
  dtS2AvailabilityKbl,
  format = "html",
  escape = FALSE,
  align = "c",
  booktabs = TRUE,
  caption = "Study 2: Data Availability" # complete caption for main document
) %>%
  kable_classic(
    full_width = FALSE,
    lightable_options = "hover",
    html_font = "Cambria"
  ) %>%
  scroll_box(width = "100%", height = "500px")
Table 4: Study 2: Data Availability
t_1 t_2 t_3 t_4 t_5 t_6 t_7 t_8 t_9 t_10 t_11 t_12 t_13 t_14 t_15 t_16 t_17 t_18 t_19 t_20 t_21 t_22 t_23 t_24 t_25 t_26 t_27 t_28 t_29 t_30 t_31 t_32 t_33 t_34 t_35 t_36 t_37 t_38 t_39 t_40 t_41 t_42 t_43 t_44 t_45 t_46 t_47 t_48 t_49 t_50 t_51 t_52 t_53 t_54 t_55 t_56 t_57 t_58 t_59 t_60 t_61 t_62 t_63 t_64 t_65 t_66 t_67 t_68
PP_1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 0 0
PP_2 0 0 1 1 1 1 0 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 0 0 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0
PP_3 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0
PP_4 0 0 0 0 1 1 1 1 0 1 0 1 1 1 1 0 1 0 1 1 1 0 1 1 1 0 0 1 1 0 1 1 1 0 1 1 0 1 1 0 1 0 0 1 1 1 1 0 0 1 1 1 0 1 1 1 1 1 1 0 0 0 0 1 0 0 0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1 1 0 1 0 0
dtS2RedInfo <- cleanM(M = as.data.frame(dtS2Availability), c = 66)
## 1: Column t_67 had a completion rate of 7.08% and was removed.
## 2: Column t_68 had a completion rate of 7.08% and was removed.
## 3: Row PP_107 had a completion rate of 7.58% and was removed.
## 4: Row PP_26 had a completion rate of 9.09% and was removed.
## 5: Row PP_100 had a completion rate of 9.09% and was removed.
## 6: Row PP_110 had a completion rate of 9.09% and was removed.
## 7: Row PP_111 had a completion rate of 10.61% and was removed.
## 8: Column t_2 had a completion rate of 15.74% and was removed.
## 9: Column t_1 had a completion rate of 18.52% and was removed.
## 10: Column t_65 had a completion rate of 18.52% and was removed.
## 11: Row PP_31 had a completion rate of 20.63% and was removed.
## 12: Column t_66 had a completion rate of 23.36% and was removed.
## 13: Row PP_87 had a completion rate of 25.81% and was removed.
## 14: Row PP_40 had a completion rate of 27.42% and was removed.
## 15: Row PP_70 had a completion rate of 29.03% and was removed.
## 16: Row PP_81 had a completion rate of 29.03% and was removed.
## 17: Row PP_12 had a completion rate of 30.65% and was removed.
## 18: Row PP_66 had a completion rate of 30.65% and was removed.
## 19: Row PP_103 had a completion rate of 32.26% and was removed.
## 20: Row PP_85 had a completion rate of 37.10% and was removed.
## 21: Row PP_71 had a completion rate of 38.71% and was removed.
## 22: Row PP_11 had a completion rate of 40.32% and was removed.
## 23: Column t_64 had a completion rate of 41.24% and was removed.
## 24: Row PP_15 had a completion rate of 42.62% and was removed.
## 25: Row PP_43 had a completion rate of 42.62% and was removed.
## 26: Row PP_6 had a completion rate of 45.90% and was removed.
## 27: Row PP_7 had a completion rate of 45.90% and was removed.
## 28: Row PP_18 had a completion rate of 45.90% and was removed.
## 29: Row PP_13 had a completion rate of 47.54% and was removed.
## 30: Column t_63 had a completion rate of 48.35% and was removed.
## 31: Row PP_29 had a completion rate of 50.00% and was removed.
## 32: Column t_4 had a completion rate of 51.11% and was removed.
## 33: Row PP_101 had a completion rate of 50.85% and was removed.
## 34: Row PP_28 had a completion rate of 52.54% and was removed.
## 35: Row PP_77 had a completion rate of 52.54% and was removed.
## 36: Row PP_49 had a completion rate of 54.24% and was removed.
## 37: Column t_3 had a completion rate of 55.81% and was removed.
## 38: Row PP_93 had a completion rate of 56.90% and was removed.
## 39: Row PP_19 had a completion rate of 58.62% and was removed.
## 40: Row PP_56 had a completion rate of 58.62% and was removed.
## 41: Row PP_60 had a completion rate of 58.62% and was removed.
## 42: Row PP_89 had a completion rate of 62.07% and was removed.
## 43: Row PP_45 had a completion rate of 63.79% and was removed.
## 44: Row PP_50 had a completion rate of 65.52% and was removed.
## 45: All row- and column means are over 66%. The final matrix has 79 rows and 58 columns.
PIDout <- gsub("PP_", "", dtS2RedInfo$rowNamesOut) %>% as.numeric
TIDout <- gsub("t_", "", dtS2RedInfo$colNamesOut) %>% as.numeric

dtS2Red <- dtS2$full %>%
  filter(
    !PID %in% PIDout,
    !TIDnum %in% TIDout
  ) %>%
  mutate(TIDnum = as.numeric(factor(TIDnum)))
rm(PIDout, TIDout)

dtS2AvailabilityRedKbl <- dtS2RedInfo$reducedMatrix
dtS2AvailabilityRedKbl[1:ncol(dtS2AvailabilityRedKbl)] <- lapply(dtS2AvailabilityRedKbl[1:ncol(dtS2AvailabilityRedKbl)], function(x) {
    cell_spec(x,
              bold = FALSE,
              color = "white",
              background = ifelse(x == 1, "green", "red")
              )
})
kbl(
  dtS2AvailabilityRedKbl,
  format = "html",
  escape = FALSE,
  align = "c",
  booktabs = TRUE,
  caption = "Study 2: Final Data Availability" # complete caption for main document
) %>%
  kable_classic(
    full_width = FALSE,
    lightable_options = "hover",
    html_font = "Cambria"
  ) %>%
  scroll_box(width = "100%", height = "500px")
Table 5: Study 2: Final Data Availability
t_5 t_6 t_7 t_8 t_9 t_10 t_11 t_12 t_13 t_14 t_15 t_16 t_17 t_18 t_19 t_20 t_21 t_22 t_23 t_24 t_25 t_26 t_27 t_28 t_29 t_30 t_31 t_32 t_33 t_34 t_35 t_36 t_37 t_38 t_39 t_40 t_41 t_42 t_43 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1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
PP_109 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0
PP_112 1 1 1 1 1 1 0 1 1 1 1 0 1 0 1 0 1 1 1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 0 0 0
PP_113 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 0 1 0 0 1 1 1 1 1 0 0 0 1 1 1 0 0 1 0 0 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 0 0 0 1

Study 3

dtS3Availability <- dtS3$full %>%
  select(
    PID,
    TIDnum
  ) %>%
  arrange(PID, TIDnum) %>%
  mutate(data = 1)
dtS3Availability <- reshape::cast(dtS3Availability, PID ~ TIDnum) %>%
  select(-PID)

rownames(dtS3Availability) <- paste("PP", 1:nrow(dtS3Availability), sep = "_")
colnames(dtS3Availability) <- paste("t", 1:ncol(dtS3Availability), sep = "_")

write.csv(dtS3Availability, "data/S3_Medical/processed/medicalAvailability.csv")

dtS3AvailabilityKbl <- dtS3Availability
dtS3AvailabilityKbl[1:ncol(dtS3AvailabilityKbl)] <- lapply(dtS3AvailabilityKbl[1:ncol(dtS3AvailabilityKbl)], function(x) {
    cell_spec(x,
              bold = FALSE,
              color = "white",
              background = ifelse(x == 1, "green", "red")
              )
})
kbl(
  dtS3AvailabilityKbl,
  format = "html",
  escape = FALSE,
  align = "c",
  booktabs = TRUE,
  caption = "Study 2: Data Availability" # complete caption for main document
) %>%
  kable_classic(
    full_width = FALSE,
    lightable_options = "hover",
    html_font = "Cambria"
  ) %>%
  scroll_box(width = "100%", height = "500px")
Table 6: Study 2: Data Availability
t_1 t_2 t_3 t_4 t_5 t_6 t_7 t_8 t_9 t_10 t_11 t_12 t_13 t_14 t_15 t_16 t_17 t_18 t_19 t_20 t_21 t_22 t_23 t_24 t_25 t_26 t_27 t_28 t_29 t_30 t_31 t_32 t_33 t_34 t_35 t_36 t_37 t_38 t_39 t_40 t_41 t_42 t_43 t_44 t_45 t_46 t_47 t_48 t_49 t_50 t_51 t_52 t_53 t_54 t_55 t_56 t_57 t_58 t_59 t_60 t_61 t_62 t_63 t_64 t_65 t_66 t_67 t_68 t_69 t_70 t_71 t_72 t_73 t_74 t_75 t_76 t_77 t_78 t_79 t_80 t_81 t_82 t_83 t_84 t_85 t_86 t_87 t_88 t_89 t_90 t_91 t_92 t_93 t_94 t_95 t_96 t_97 t_98 t_99 t_100 t_101 t_102 t_103 t_104 t_105 t_106 t_107 t_108 t_109 t_110 t_111 t_112 t_113 t_114 t_115 t_116 t_117 t_118 t_119 t_120 t_121 t_122 t_123 t_124 t_125 t_126 t_127 t_128 t_129 t_130 t_131 t_132 t_133 t_134 t_135 t_136 t_137 t_138 t_139 t_140 t_141 t_142 t_143 t_144 t_145 t_146 t_147 t_148 t_149 t_150 t_151 t_152 t_153 t_154 t_155
PP_1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 1 0 1 1 0 0 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PP_2 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PP_71 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 2 0 1 1 1 1 0 1 1 0 0 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 0 1 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
rm(dtS3AvailabilityKbl)
dtS3RedInfo <- cleanM(M = as.data.frame(dtS3Availability), c = 66)
## 1: Column t_1 had a completion rate of 1.41% and was removed.
## 2: Column t_2 had a completion rate of 1.41% and was removed.
## 3: Column t_3 had a completion rate of 1.41% and was removed.
## 4: Column t_4 had a completion rate of 1.41% and was removed.
## 5: Column t_5 had a completion rate of 1.41% and was removed.
## 6: Column t_136 had a completion rate of 1.41% and was removed.
## 7: Column t_138 had a completion rate of 1.41% and was removed.
## 8: Column t_147 had a completion rate of 1.41% and was removed.
## 9: Column t_148 had a completion rate of 1.41% and was removed.
## 10: Column t_149 had a completion rate of 1.41% and was removed.
## 11: Column t_150 had a completion rate of 1.41% and was removed.
## 12: Column t_152 had a completion rate of 1.41% and was removed.
## 13: Column t_153 had a completion rate of 1.41% and was removed.
## 14: Column t_154 had a completion rate of 1.41% and was removed.
## 15: Column t_155 had a completion rate of 1.41% and was removed.
## 16: Column t_137 had a completion rate of 2.82% and was removed.
## 17: Column t_139 had a completion rate of 2.82% and was removed.
## 18: Column t_140 had a completion rate of 2.82% and was removed.
## 19: Column t_141 had a completion rate of 2.82% and was removed.
## 20: Column t_142 had a completion rate of 2.82% and was removed.
## 21: Column t_143 had a completion rate of 2.82% and was removed.
## 22: Column t_144 had a completion rate of 2.82% and was removed.
## 23: Column t_151 had a completion rate of 2.82% and was removed.
## 24: Column t_135 had a completion rate of 4.23% and was removed.
## 25: Column t_145 had a completion rate of 4.23% and was removed.
## 26: Column t_146 had a completion rate of 4.23% and was removed.
## 27: Column t_6 had a completion rate of 7.04% and was removed.
## 28: Column t_110 had a completion rate of 8.45% and was removed.
## 29: Column t_122 had a completion rate of 8.45% and was removed.
## 30: Column t_133 had a completion rate of 8.45% and was removed.
## 31: Column t_107 had a completion rate of 9.86% and was removed.
## 32: Column t_111 had a completion rate of 9.86% and was removed.
## 33: Column t_120 had a completion rate of 9.86% and was removed.
## 34: Column t_134 had a completion rate of 9.86% and was removed.
## 35: Row PP_1 had a completion rate of 10.74% and was removed.
## 36: Column t_104 had a completion rate of 11.43% and was removed.
## 37: Column t_106 had a completion rate of 11.43% and was removed.
## 38: Column t_124 had a completion rate of 11.43% and was removed.
## 39: Column t_127 had a completion rate of 11.43% and was removed.
## 40: Column t_128 had a completion rate of 11.43% and was removed.
## 41: Column t_121 had a completion rate of 12.86% and was removed.
## 42: Column t_125 had a completion rate of 12.86% and was removed.
## 43: Column t_132 had a completion rate of 12.86% and was removed.
## 44: Column t_100 had a completion rate of 14.29% and was removed.
## 45: Column t_105 had a completion rate of 14.29% and was removed.
## 46: Column t_117 had a completion rate of 14.29% and was removed.
## 47: Column t_123 had a completion rate of 14.29% and was removed.
## 48: Column t_126 had a completion rate of 14.29% and was removed.
## 49: Column t_88 had a completion rate of 15.71% and was removed.
## 50: Column t_95 had a completion rate of 15.71% and was removed.
## 51: Column t_97 had a completion rate of 15.71% and was removed.
## 52: Column t_101 had a completion rate of 15.71% and was removed.
## 53: Column t_102 had a completion rate of 15.71% and was removed.
## 54: Column t_113 had a completion rate of 15.71% and was removed.
## 55: Column t_116 had a completion rate of 15.71% and was removed.
## 56: Column t_119 had a completion rate of 15.71% and was removed.
## 57: Column t_129 had a completion rate of 15.71% and was removed.
## 58: Column t_131 had a completion rate of 15.71% and was removed.
## 59: Column t_92 had a completion rate of 17.14% and was removed.
## 60: Column t_98 had a completion rate of 17.14% and was removed.
## 61: Column t_99 had a completion rate of 17.14% and was removed.
## 62: Column t_103 had a completion rate of 17.14% and was removed.
## 63: Column t_112 had a completion rate of 17.14% and was removed.
## 64: Column t_130 had a completion rate of 17.14% and was removed.
## 65: Column t_108 had a completion rate of 18.57% and was removed.
## 66: Column t_109 had a completion rate of 18.57% and was removed.
## 67: Column t_114 had a completion rate of 18.57% and was removed.
## 68: Column t_115 had a completion rate of 18.57% and was removed.
## 69: Row PP_36 had a completion rate of 19.32% and was removed.
## 70: Column t_84 had a completion rate of 20.29% and was removed.
## 71: Column t_91 had a completion rate of 20.29% and was removed.
## 72: Column t_93 had a completion rate of 20.29% and was removed.
## 73: Column t_96 had a completion rate of 20.29% and was removed.
## 74: Row PP_18 had a completion rate of 21.43% and was removed.
## 75: Column t_118 had a completion rate of 22.06% and was removed.
## 76: Row PP_45 had a completion rate of 22.89% and was removed.
## 77: Row PP_8 had a completion rate of 24.10% and was removed.
## 78: Row PP_68 had a completion rate of 24.10% and was removed.
## 79: Column t_90 had a completion rate of 26.15% and was removed.
## 80: Row PP_5 had a completion rate of 26.83% and was removed.
## 81: Column t_86 had a completion rate of 26.56% and was removed.
## 82: Row PP_6 had a completion rate of 27.16% and was removed.
## 83: Column t_94 had a completion rate of 26.98% and was removed.
## 84: Column t_87 had a completion rate of 28.57% and was removed.
## 85: Row PP_35 had a completion rate of 27.85% and was removed.
## 86: Column t_89 had a completion rate of 29.03% and was removed.
## 87: Row PP_46 had a completion rate of 28.21% and was removed.
## 88: Row PP_38 had a completion rate of 29.49% and was removed.
## 89: Column t_85 had a completion rate of 30.00% and was removed.
## 90: Row PP_53 had a completion rate of 33.77% and was removed.
## 91: Column t_80 had a completion rate of 37.29% and was removed.
## 92: Column t_82 had a completion rate of 37.29% and was removed.
## 93: Row PP_54 had a completion rate of 38.67% and was removed.
## 94: Column t_74 had a completion rate of 39.66% and was removed.
## 95: Column t_83 had a completion rate of 39.66% and was removed.
## 96: Row PP_13 had a completion rate of 41.10% and was removed.
## 97: Row PP_41 had a completion rate of 41.10% and was removed.
## 98: Column t_72 had a completion rate of 42.86% and was removed.
## 99: Row PP_39 had a completion rate of 44.44% and was removed.
## 100: Column t_79 had a completion rate of 45.45% and was removed.
## 101: Column t_81 had a completion rate of 45.45% and was removed.
## 102: Row PP_47 had a completion rate of 47.14% and was removed.
## 103: Column t_7 had a completion rate of 48.15% and was removed.
## 104: Column t_8 had a completion rate of 48.15% and was removed.
## 105: Column t_75 had a completion rate of 48.15% and was removed.
## 106: Column t_69 had a completion rate of 50.00% and was removed.
## 107: Row PP_69 had a completion rate of 50.00% and was removed.
## 108: Column t_77 had a completion rate of 49.06% and was removed.
## 109: Column t_70 had a completion rate of 50.94% and was removed.
## 110: Row PP_31 had a completion rate of 51.56% and was removed.
## 111: Row PP_12 had a completion rate of 53.12% and was removed.
## 112: Column t_76 had a completion rate of 52.94% and was removed.
## 113: Row PP_63 had a completion rate of 52.38% and was removed.
## 114: Column t_78 had a completion rate of 52.00% and was removed.
## 115: Column t_71 had a completion rate of 54.00% and was removed.
## 116: Row PP_9 had a completion rate of 55.74% and was removed.
## 117: Row PP_26 had a completion rate of 55.74% and was removed.
## 118: Row PP_15 had a completion rate of 62.30% and was removed.
## 119: Column t_73 had a completion rate of 61.70% and was removed.
## 120: Column t_10 had a completion rate of 63.83% and was removed.
## 121: Column t_67 had a completion rate of 63.83% and was removed.
## 122: Column t_68 had a completion rate of 63.83% and was removed.
## 123: All row- and column means are over 66%. The final matrix has 47 rows and 57 columns.
PIDout <- gsub("PP_", "", dtS3RedInfo$rowNamesOut) %>% as.numeric
TIDout <- gsub("t_", "", dtS3RedInfo$colNamesOut) %>% as.numeric

dtS3Red <- dtS3$full %>%
  filter(
    !PID %in% PIDout,
    !TIDnum %in% TIDout
  ) %>%
  mutate(TIDnum = as.numeric(factor(TIDnum)))
rm(PIDout, TIDout)

dtS3AvailabilityRedKbl <- dtS3RedInfo$reducedMatrix
dtS3AvailabilityRedKbl[1:ncol(dtS3AvailabilityRedKbl)] <- lapply(dtS3AvailabilityRedKbl[1:ncol(dtS3AvailabilityRedKbl)], function(x) {
    cell_spec(x,
              bold = FALSE,
              color = "white",
              background = ifelse(x == 1, "green", "red")
              )
})
kbl(
  dtS3AvailabilityRedKbl,
  format = "html",
  escape = FALSE,
  align = "c",
  booktabs = TRUE,
  caption = "Study 3: Final Data Availability" # complete caption for main document
) %>%
  kable_classic(
    full_width = FALSE,
    lightable_options = "hover",
    html_font = "Cambria"
  ) %>%
  scroll_box(width = "100%", height = "500px")
Table 7: Study 3: Final Data Availability
t_9 t_11 t_12 t_13 t_14 t_15 t_16 t_17 t_18 t_19 t_20 t_21 t_22 t_23 t_24 t_25 t_26 t_27 t_28 t_29 t_30 t_31 t_32 t_33 t_34 t_35 t_36 t_37 t_38 t_39 t_40 t_41 t_42 t_43 t_44 t_45 t_46 t_47 t_48 t_49 t_50 t_51 t_52 t_53 t_54 t_55 t_56 t_57 t_58 t_59 t_60 t_61 t_62 t_63 t_64 t_65 t_66
PP_2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1
PP_3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
PP_4 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 2 1 0 1 1 1 1 1 1 1 2 1 1 1 1 1 0 1 1 1 2 0 1 1 1 1 2 0 1 1 1 1 2 1 0
PP_7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 0 1 1 0 0 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 0 1 0 0 1 1 0 1 1

Time Scales and Timepoint Aggregation

varNamesPre <- varNames %>%
  filter(
    surveyS1 == "pre",
    surveyS2 == "pre",
    str_detect(surveyS3, "^pre")
  ) %>%
  select(varNam)
varNamesPreFull <-
  data.frame(varNam = Reduce(intersect, list(
    names(dtS1$full), names(dtS3$full), names(dtS3$full)
  ))) %>%
  filter(str_detect(varNam, ".pre$"))

varNamesDaily <- varNames %>%
  filter(
    surveyS1 == "daily",
    surveyS2 == "daily",
    surveyS3 == "daily"
  ) %>%
  select(varNam)
varNamesDailyFull <-
  data.frame(varNam = Reduce(intersect, list(
    names(dtS1Red), names(dtS3Red), names(dtS3Red)
  ))) %>%
  filter(!str_detect(varNam, ".pre$|.post$"))

varNamesPost <- varNames %>%
  filter(
    surveyS1 == "post",
    surveyS2 == "post",
    surveyS3 == "post"
  ) %>%
  select(varNam)
varNamesPostFull <-
  data.frame(varNam = Reduce(intersect, list(
    names(dtS1Red), names(dtS3Red), names(dtS3Red)
  ))) %>%
  filter(str_detect(varNam, ".post$"))
# Main Analysis: 3MPCA (common variables across studies)
dropVarPcaMain <- c(
  # Meta Data
  "last_outside_referrer",
  "created",
  "ended",
  "ip_address",
  "date",
  "ResponseId",
  "server_language",
  "Meta_Browser",
  # Interaction Dummies (non-continuous)
  "IntergroupContact",
  "IngroupContact",
  "InteractionDum",
  # Interaction Counts (non-continuous)
  "ContactNum",
  "NonDutchNum",
  # Interaction Descriptives (non-continuous)
  "duration",
  "dyadGroup",
  "groupSize",
  # Keyneed Freetexts (non-continuous)
  "KeyNeed",
  "DaytimeNeed",
  # Relatedness individual items
  "relatednessSelf",
  "relatednessOther",
  "relatednessNoInteraction"
)


varNam3mpcaMain <- varNamesDailyFull %>%
  filter(!varNam %in% dropVarPcaMain) %>%
  pull

dtMain3mpca <- rbind(
  dtS1Red %>% select(any_of(varNam3mpcaMain)) %>% mutate(study = "S1"),
  dtS3Red %>% select(any_of(varNam3mpcaMain)) %>% mutate(study = "S2"),
  dtS3Red %>% select(any_of(varNam3mpcaMain)) %>% mutate(study = "S3")
  ) %>%
  group_by(study, PID) %>%
  mutate(ID = cur_group_id()) %>%
  ungroup %>%
  mutate(
    date = as.Date(gsub(" .*", "", TID)),
    week = strftime(date, format = "%Y-W%V")
    ) %>%
  select(
    ID,
    PID,
    TID,
    date,
    week,
    TIDnum,
    study,
    everything()
  ) %>%
  arrange(ID, TIDnum)

dtMain3mpcaDaily <- dtMain3mpca %>%
  group_by(ID, date, study) %>%
  summarise_if(is.numeric, mean, na.rm = TRUE) %>%
  ungroup %>%
  group_by(study) %>%
  mutate(TIDnum = as.numeric(factor(date))) %>%
  ungroup %>%
  select(ID, date, TIDnum, everything()) %>%
  mutate_all(~ifelse(is.nan(.), NA, .))

dtMain3mpcaWeekly <- dtMain3mpca %>%
  group_by(ID, week, study) %>%
  summarise_if(is.numeric, mean, na.rm = TRUE) %>%
  ungroup %>%
  group_by(study) %>%
  mutate(TIDnum = as.numeric(factor(week))) %>%
  ungroup %>%
  select(ID, week, TIDnum, everything()) %>%
  mutate_all(~ifelse(is.nan(.), NA, .))

Timescale ML test

dtMain3mpca <- dtMain3mpca %>%
  mutate(
    TIDdate = as.numeric(factor(date)),
    TIDweek = as.numeric(factor(week))
  )

test <-
  lme4::lmer(KeyNeedFulfillment ~ 1 + (1 + TIDnum + TIDdate + TIDweek | PID),
    data = dtMain3mpca
  ) # use optim if it does not converge

test2 <-
  lme(
    KeyNeedFulfillment ~ 1,
    random = ~ 1 + TIDnum + TIDdate + TIDweek | PID,
    data = dtMain3mpca %>% filter(!is.na(KeyNeedFulfillment)),
    control = list(opt = "nlmimb")
  ) # use optim if it does not converge

summary(test2)
## Linear mixed-effects model fit by REML
##   Data: dtMain3mpca %>% filter(!is.na(KeyNeedFulfillment)) 
##     AIC   BIC logLik
##   42130 42208 -21053
## 
## Random effects:
##  Formula: ~1 + TIDnum + TIDdate + TIDweek | PID
##  Structure: General positive-definite, Log-Cholesky parametrization
##             StdDev Corr                
## (Intercept) 86.058 (Intr) TIDnum TIDdat
## TIDnum       1.137  0.976              
## TIDdate      1.216 -0.992 -0.987       
## TIDweek      6.893 -0.993 -0.988  0.994
## Residual    16.272                     
## 
## Fixed effects:  KeyNeedFulfillment ~ 1 
##             Value Std.Error   DF t-value p-value
## (Intercept) 82.89     1.219 4903   67.99       0
## 
## Standardized Within-Group Residuals:
##     Min      Q1     Med      Q3     Max 
## -5.4533 -0.2673  0.1966  0.5387  2.7533 
## 
## Number of Observations: 4959
## Number of Groups: 56
#summ(test, digits = 3, center = FALSE)
anova(test2)
##             numDF denDF F-value p-value
## (Intercept)     1  4903    4623  <.0001

Multiple Imputation

library(Amelia)

dtMain3mpcaMI<- dtMain3mpca %>%
  select(
    -date,
    -TID,
    -week
  ) %>%
  as.data.frame

a.out <- amelia(dtMain3mpcaMI, m = 20, ts = "TIDnum", idvars = c("ID", "PID", "study"))
## -- Imputation 1 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26 27 28 29
## 
## -- Imputation 2 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26 27 28 29
## 
## -- Imputation 3 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26 27 28 29
## 
## -- Imputation 4 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26 27
## 
## -- Imputation 5 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26 27 28 29 30
## 
## -- Imputation 6 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25
## 
## -- Imputation 7 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26 27 28 29
## 
## -- Imputation 8 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26
## 
## -- Imputation 9 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26 27 28
## 
## -- Imputation 10 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26 27
## 
## -- Imputation 11 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26 27 28 29
## 
## -- Imputation 12 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26 27 28 29 30 31
## 
## -- Imputation 13 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26 27
## 
## -- Imputation 14 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26 27 28 29 30 31 32 33
## 
## -- Imputation 15 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26
## 
## -- Imputation 16 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26 27 28
## 
## -- Imputation 17 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26 27 28
## 
## -- Imputation 18 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26 27 28
## 
## -- Imputation 19 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26 27 28 29
## 
## -- Imputation 20 --
## 
##   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
##  21 22 23 24 25 26 27 28 29 30

Center and Normalize

varNam3mpcaMainAnalysis <- varNamesDailyFull %>%
  filter(!varNam %in% c(dropVarPcaMain, "PID", "TID", "TIDnum")) %>%
  pull

dtMain3mpcaNorm <-
  PCAnorm(data = dtMain3mpca,
          pid = "ID",
          tid = "TIDnum",
          selection = varNam3mpcaMainAnalysis)
## @Jannis: Don't forget to fix the filter once sample section is finalized.

Long to Wide

dtMain3mpcaWideGmc <- dtMain3mpcaNorm %>% 
  select(
    ID,
    TIDnum,
    ends_with("_gmc")
  ) %>%
  reshape2::melt(.,
              id.vars = c("ID", "TIDnum")) %>%
  mutate(variable = paste(variable, TIDnum, sep = "_")) %>%
  select(-TIDnum) %>% 
  arrange(variable, ID) %>%
  reshape(., idvar = "ID", timevar = "variable", direction = "wide")
  #pivot_wider(names_from = variable, values_from = value)

Three-Way ANOVA

library(ThreeWay)
# threewayanova(
#   Y = dtMain3mpcaWideGmc,
#   n = nrow(dtMain3mpcaWideGmc), # Nr. ppt.s
#   m = length(unique(dtMain3mpcaNorm$TIDnum)), # Nr. time points
#   p = length(varNam3mpcaMainAnalysis) # Nr. variables
# )

Plot (x = var, y = z, group/line = t)




Plots per Item

The three-mode PCA ultimately aims to explain the most variance with the fewest components (by maximizing the variance of data mapped in a lower dimensional space — often by maximally separating groups of cases with similar variable patterns). Importantly, this procedure depends on variances and covariances to be present within the data. As one of our three modes is time and variance over time is not always given (e.g., because a variable is stable over the measured time span, such as personality over a month), it becomes important to assess whether a dimension reduction is possible for the variables measured during the measured time period. We, thus, start by visually inspecting the average changes and variance developments of all potentially relevant variables. We hope so see changes within the means and standard deviations over the measurement period.

Study 1 (Worker)

The first study, utilized not only the smallest sample but also a slightly different set of measured variables compared to the later two studies. Several variables are consistent across all three studies (e.g., types of social interactions, interaction needs, self-determiantion theory needs, outgroup attitudes, and experienced well-being). Study 1 additionally included several emotion and mood measurements but fewer cognitive and behavioral measures than studies two and three.

We first select all potentially relevant variables and their labels, and then group the variables in small groups of one to three variables for plotting.

#median(rbind(rbind(dtS1$raw.pre$timeNL_1, dtS2$raw.pre$timeNL), dtS3$raw.pre$timeNL), na.rm=TRUE)
varListWorker <- 
  c(
    "IntergroupContact",
    "InteractionDum",
    "DaytimeNeedFullfillment",
    "InteractionNeedFullfillment",
    "autonomy",
    "competence",
    "relatedness",
    "AttitudesDutch",
    "AttitudesPartner",
    "ExWB",
    "alertness",
    "calmness",
    "valence",
    "MDMQ.v1_1",
    "MDMQ.v1_2",
    "MDMQ.v1_3",
    "MDMQ.v1_4",
    "MDMQ.v1_5",
    "MDMQ.v1_6",
    "MDMQ.v1_7",
    "MDMQ.v1_8",
    "MDMQ.v1_9",
    "MDMQ.v1_10",
    "MDMQ.v1_11",
    "MDMQ.v1_12",
    "MDMQ.v1_13",
    "MDMQ.v2_1",
    "MDMQ.v2_2",
    "MDMQ.v2_3",
    "MDMQ.v2_4",
    "MDMQ.v2_5",
    "MDMQ.v2_6",
    "MDMQ.v2_7",
    "MDMQ.v2_8",
    "MDMQ.v2_9",
    "MDMQ.v2_10",
    "MDMQ.v2_11",
    "MDMQ.v2_12",
    "MDMQ.v2_13"
  )

varNameListWorker <- 
  c(
    "IntergroupContact" = "Dutch Interaction",
    "InteractionDum" = "Any Interaction",
    "DaytimeNeedFullfillment" = "Daytime Core Motive Fulfillment",
    "InteractionNeedFullfillment" = "Interaction Core Motive Fulfillment",
    "autonomy" = "Autonomy",
    "competence" = "Competence",
    "relatedness" = "Relatedness",
    "AttitudesDutch" = "Outgroup Attitude",
    "AttitudesPartner" = "Attitude Interaction Partner",
    "ExWB" = "Sadness Happiness",
    "alertness" = "Alertness",
    "calmness" = "Calmness",
    "valence" = "Emotional Valence",
    "MDMQ.v1_1" = "content",
    "MDMQ.v1_2" = "rested",
    "MDMQ.v1_3" = "restless",
    "MDMQ.v1_4" = "bad",
    "MDMQ.v1_5" = "worn-out",
    "MDMQ.v1_6" = "composed",
    "MDMQ.v1_7" = "tired",
    "MDMQ.v1_8" = "great",
    "MDMQ.v1_9" = "uneasy",
    "MDMQ.v1_10" = "energetic",
    "MDMQ.v1_11" = "uncomfortable",
    "MDMQ.v1_12" = "relaxed",
    "MDMQ.v1_13" = "alive and vital",
    "MDMQ.v2_1" = "sleepy",
    "MDMQ.v2_2" = "good",
    "MDMQ.v2_3" = "at ease",
    "MDMQ.v2_4" = "unhappy",
    "MDMQ.v2_5" = "alert",
    "MDMQ.v2_6" = "discontent",
    "MDMQ.v2_7" = "tense",
    "MDMQ.v2_8" = "fresh",
    "MDMQ.v2_9" = "happy",
    "MDMQ.v2_10" = "nervous",
    "MDMQ.v2_11" = "exhausted",
    "MDMQ.v2_12" = "calm",
    "MDMQ.v2_13" = "alive and vital"
  )

dtS1$viz <- list()

dtS1$vizall <- dtS1$full %>%
  select(
    PID,
    TID,
    TIDnum,
    all_of(varListWorker)
  )

dtS1$viz$Interaction <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    IntergroupContact,
    InteractionDum
  )

dtS1$viz$KeyNeed <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    DaytimeNeedFullfillment,
    InteractionNeedFullfillment
  )

dtS1$viz$SDT <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    autonomy,
    relatedness, 
    competence
  )

dtS1$viz$Attitudes <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    starts_with("Attitudes")
  )

dtS1$viz$WB <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    ExWB
  )

dtS1$viz$MoodOverall <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    alertness,
    calmness,
    valence
  )

dtS1$viz$MoodV01Pt01 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v1_1,
    MDMQ.v1_2
  )

dtS1$viz$MoodV01Pt02 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v1_3,
    MDMQ.v1_4
  )

dtS1$viz$MoodV01Pt03 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v1_5,
    MDMQ.v1_6
  )

dtS1$viz$MoodV01Pt04 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v1_7,
    MDMQ.v1_8
  )

dtS1$viz$MoodV01Pt05 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v1_9,
    MDMQ.v1_10
  )

dtS1$viz$MoodV01Pt06 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v1_11,
    MDMQ.v1_12,
    MDMQ.v1_13
  )

dtS1$viz$MoodV02Pt01 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v2_1,
    MDMQ.v2_2
  )

dtS1$viz$MoodV02Pt02 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v2_3,
    MDMQ.v2_4
  )

dtS1$viz$MoodV02Pt03 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v2_5,
    MDMQ.v2_6
  )

dtS1$viz$MoodV02Pt04 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v2_7,
    MDMQ.v2_8
  )

dtS1$viz$MoodV02Pt05 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v2_9,
    MDMQ.v2_10
  )

dtS1$viz$MoodV02Pt06 <- dtS1$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    MDMQ.v2_11,
    MDMQ.v2_12,
    MDMQ.v2_13
  )

Mean Plots

We begin by plotting the item means of all variables. We always only display one to three variables jointly to improve visual inspection. We plot the means of the individual variables for each measurement occasion, summarizing the responses of all participants at any given time point. We additionally plot the data availability of each variable as a marginal plot above the main plot. The displayed time axis is the measurement index rather than the actual date to ensure comparability of the changes between each measurement. Plots with the raw date-time axis are saved and can be displayed if necessary.

SD Plots

To illustrate the developments of variance around the previously displayed means, we then plot the item standard deviations of all variables. We, thus, plot the average variation from the mean for each individual variable, again summarizing the responses of all participants at any given time point. We retain the same variable grouping, the data availability line plot, and the measurement index as the x axis.

Study 2 (Student)

During the second study we collected the largest sample and additionally collected a range of motivations as well as pro-social and anti-social behaviors.

We, again, select all potentially relevant variables and their labels, and then group the variables in small groups of one to three variables for plotting.

varListStudent <- 
  c(
    "IntergroupContact",
    "InteractionDum",
    # "KeyNeedFullfillment",
    # "KeyNeedImp",
    "DaytimeNeedFullfillment",
    #"DaytimeNeedImportance",
    "InteractionNeedFullfillment",
    #"InteractionNeedImportance",
    "AntiSo1",
    "AntiSo2",
    "AntiSo3",
    "AntiSo4",
    "AntiSo5",
    "AntiSo6",
    "AntiSo7",
    "ProSo1",
    "ProSo2",
    "ProSo3",
    "ProSo4",
    "StudentGoal01",
    "StudentGoal02",
    "StudentGoal03",
    "StudentGoal04",
    "StudentGoal05",
    "StudentGoal06",
    "StudentGoal07",
    "StudentGoal08",
    "StudentGoal09",
    "StudentGoal10",
    "autonomy",
    "competence",
    # Break relatedness up into interaction vs. no interaction(?)
    # vars are already calculated
    "relatedness",
    "AttitudesDutch",
    "AttitudesPartner",
    "ExWB",
    #"angry",
    #"afraid",
    #"energy",
    #"lonelyAlways",
    "Event"
  )

varNameListStudent <- 
  c(
    "IntergroupContact" = "Dutch Interaction",
    "InteractionDum" = "Any Interaction",
    # "KeyNeedFulfillment" = "Key Need Fulfillment",
    # "KeyNeedImp" = "Key Need Importance",
    "DaytimeNeedFullfillment" = "Daytime Core Motive Fulfillment",
    #"DaytimeNeedImportance" = "Daytime Core Motive Importance",
    "InteractionNeedFullfillment" = "Interaction Core Motive Fulfillment",
    #"InteractionNeedImportance" = "Interaction Core Motive Importance",
    "AntiSo1" = "Put someone down",
    "AntiSo2" = "Show little attention in someones opinion",
    "AntiSo3" = "Demeaning remarks",
    "AntiSo4" = "Inpropperly addressing someone",
    "AntiSo5" = "Ignored or excluded someone",
    "AntiSo6" = "Doubt someones judgement",
    "AntiSo7" = "Unwanted attempts of personal matters",
    "ProSo1" = "Listen to someones problems",
    "ProSo2" = "Cheer someone up",
    "ProSo3" = "Help someone get things done",
    "ProSo4" = "Help someone with responsibilities",
    "StudentGoal01" = "Social support and connectedness",
    "StudentGoal02" = "Romantic or sexual relationship",
    "StudentGoal03" = "Academic",
    "StudentGoal04" = "Career",
    "StudentGoal05" = "Financial",
    "StudentGoal06" = "Health and fitness",
    "StudentGoal07" = "Leasure and fun",
    "StudentGoal08" = "Personal improvement and growth",
    "StudentGoal09" = "Service and help",
    "StudentGoal10" = "Spiritual or religious",
    "autonomy" = "Autonomy",
    "competence" = "Competence",
    # Break relatedness up into interaction vs. no interaction(?)
    # vars are already calculated
    "relatedness" = "Relatedness",
    "AttitudesDutch" = "Outgroup Attitude",
    "AttitudesPartner" = "Attitude Interaction Partner",
    "ExWB" = "Sadness Happiness",
    #"angry" = "Anger",
    #"afraid" = "Anxiety",
    #"energy" = "Energy",
    #"lonelyAlways" = "Loneliness",
    "Event" = "Positive or negative event present"
  )

dtS2$viz <- list()

dtS2$vizall <- dtS2$full %>%
  select(
    PID,
    TID,
    TIDnum,
    all_of(varListStudent)
  )

dtS2$viz$Interaction <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    IntergroupContact,
    InteractionDum
  )

dtS2$viz$KeyNeed <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    DaytimeNeedFullfillment,
    InteractionNeedFullfillment
  )

dtS2$viz$AntiSocialBehaviorPt1 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    AntiSo1,
    AntiSo2,
    AntiSo3
  )

dtS2$viz$AntiSocialBehaviorPt2 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    AntiSo4,
    AntiSo5
  )

dtS2$viz$AntiSocialBehaviorPt3 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    AntiSo6,
    AntiSo7
  )

dtS2$viz$ProSocialBehaviorPt1 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    ProSo1,
    ProSo2
  )

dtS2$viz$ProSocialBehaviorPt2 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    ProSo3,
    ProSo4
  )

dtS2$viz$GoalsPt1 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal01,
    StudentGoal02
  )

dtS2$viz$GoalsPt2 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal03,
    StudentGoal04
  )

dtS2$viz$GoalsPt3 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal05,
    StudentGoal06
  )

dtS2$viz$GoalsPt4 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal07,
    StudentGoal08
  )

dtS2$viz$GoalsPt5 <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal09,
    StudentGoal10
  )

dtS2$viz$SDT <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    autonomy,
    relatedness, 
    competence
  )

dtS2$viz$Attitudes <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    starts_with("Attitudes")
  )

dtS2$viz$WB <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    ExWB
  )

dtS2$viz$Event <- dtS2$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    Event
  )

Mean Plots

We again begin by plotting the item means of all variables. The plotting method is identical to that of Study 1.

SD Plots

We then also plot the average variation around the mean for each time point and variable. The plotting method is identical to that of Study 1.

Study 3 (Medical)

The third study uses a similar set up as Study 2 but targets a more vulnerable sample (of young medical professionals). While most key variables are identical to Study 2, in this last study we additionally collected several cognitive evaluations (e.g., importance ratings) and emotional status measures (e.g., anger, nervousness, energy, and loneliness).

We, again, select all potentially relevant variables and their labels, and then group the variables in small groups of one to three variables for plotting.

varListMedical <- 
  c(
    "IntergroupContact",
    "InteractionDum",
    # "KeyNeedFulfillment",
    # "KeyNeedImp",
    "DaytimeNeedFullfillment",
    "DaytimeNeedImportance",
    "InteractionNeedFullfillment",
    "InteractionNeedImportance",
    "AntiSo1",
    "AntiSo2",
    "AntiSo3",
    "AntiSo4",
    "AntiSo5",
    "AntiSo6",
    "AntiSo7",
    "ProSo1",
    "ProSo2",
    "ProSo3",
    "ProSo4",
    "StudentGoal01",
    "StudentGoal02",
    "StudentGoal03",
    "StudentGoal04",
    "StudentGoal05",
    "StudentGoal06",
    "StudentGoal07",
    "StudentGoal08",
    "StudentGoal09",
    "StudentGoal10",
    "Autonomy",
    "Competence",
    # Break relatedness up into interaction vs. no interaction(?)
    # vars are already calculated
    "relatedness",
    "AttitudesDutch",
    "AttitudesPartner",
    "exWB",
    "angry",
    "afraid",
    "energy",
    "lonelyAlways",
    "Event"
  )

varNameListMedical <- 
  c(
    "IntergroupContact" = "Dutch Interaction",
    "InteractionDum" = "Any Interaction",
    # "KeyNeedFulfillment" = "Key Need Fulfillment",
    # "KeyNeedImp" = "Key Need Importance",
    "DaytimeNeedFullfillment" = "Daytime Core Motive Fulfillment",
    "DaytimeNeedImportance" = "Daytime Core Motive Importance",
    "InteractionNeedFullfillment" = "Interaction Core Motive Fulfillment",
    "InteractionNeedImportance" = "Interaction Core Motive Importance",
    "AntiSo1" = "Put someone down",
    "AntiSo2" = "Show little attention in someones opinion",
    "AntiSo3" = "Demeaning remarks",
    "AntiSo4" = "Inpropperly addressing someone",
    "AntiSo5" = "Ignored or excluded someone",
    "AntiSo6" = "Doubt someones judgement",
    "AntiSo7" = "Unwanted attempts of personal matters",
    "ProSo1" = "Listen to someones problems",
    "ProSo2" = "Cheer someone up",
    "ProSo3" = "Help someone get things done",
    "ProSo4" = "Help someone with responsibilities",
    "StudentGoal01" = "Social support and connectedness",
    "StudentGoal02" = "Romantic or sexual relationship",
    "StudentGoal03" = "Academic",
    "StudentGoal04" = "Career",
    "StudentGoal05" = "Financial",
    "StudentGoal06" = "Health and fitness",
    "StudentGoal07" = "Leasure and fun",
    "StudentGoal08" = "Personal improvement and growth",
    "StudentGoal09" = "Service and help",
    "StudentGoal10" = "Spiritual or religious",
    "Autonomy" = "Autonomy",
    "Competence" = "Competence",
    # Break relatedness up into interaction vs. no interaction(?)
    # vars are already calculated
    "relatedness" = "Relatedness",
    "AttitudesDutch" = "Outgroup Attitude",
    "AttitudesPartner" = "Attitude Interaction Partner",
    "exWB" = "Sadness Happiness",
    "angry" = "Anger",
    "afraid" = "Anxiety",
    "energy" = "Energy",
    "lonelyAlways" = "Loneliness",
    "Event" = "Positive or negative event present"
  )

dtS3$viz <- list()

dtS3$vizall <- dtS3$full %>%
  select(
    PID,
    TID,
    TIDnum,
    all_of(varListMedical)
  )

dtS3$viz$Interaction <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    IntergroupContact,
    InteractionDum
  )

dtS3$viz$KeyNeedFulfillment <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    DaytimeNeedFullfillment,
    InteractionNeedFullfillment
  )

dtS3$viz$KeyNeedImportance <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    DaytimeNeedImportance,
    InteractionNeedImportance
  )

dtS3$viz$AntiSocialBehaviorPt1 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    AntiSo1,
    AntiSo2,
    AntiSo3
  )

dtS3$viz$AntiSocialBehaviorPt2 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    AntiSo4,
    AntiSo5
  )

dtS3$viz$AntiSocialBehaviorPt3 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    AntiSo6,
    AntiSo7
  )

dtS3$viz$ProSocialBehaviorPt1 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    ProSo1,
    ProSo2
  )

dtS3$viz$ProSocialBehaviorPt2 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    ProSo3,
    ProSo4
  )

dtS3$viz$GoalsPt1 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal01,
    StudentGoal02
  )

dtS3$viz$GoalsPt2 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal03,
    StudentGoal04
  )

dtS3$viz$GoalsPt3 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal05,
    StudentGoal06
  )

dtS3$viz$GoalsPt4 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal07,
    StudentGoal08
  )

dtS3$viz$GoalsPt5 <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    StudentGoal09,
    StudentGoal10
  )

dtS3$viz$SDT <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    autonomy,
    relatedness, 
    competence
  )

dtS3$viz$Attitudes <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    starts_with("Attitudes")
  )

dtS3$viz$WB <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    exWB
  )

dtS3$viz$Emotion <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    angry,
    afraid,
    energy,
    lonelyAlways
  )

dtS3$viz$Event <- dtS3$vizall %>%
  select(
    PID,
    TID,
    TIDnum,
    Event
  )

Mean Plots

As with the previous studies, we begin by plotting the item means of all variables. The plotting method is identical to that of Studies 1 and 2.

SD Plots

Lastly, also again plot the item standard deviations of all variables at each time point. The plotting procedures are again identical to Studies 1 and 2.




Software Information

The full ResponseId information with all relevant system information and all loaded and installed packages is available in the collapsible section below.

System Info
Table 8: R environment session info for reproducibility of results
Setting Value
version R version 4.1.1 (2021-08-10)
os macOS Big Sur 10.16
system x86_64, darwin17.0
ui X11
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz Europe/Amsterdam
date 2022-06-20

Package Info
Table 9: Package info for reproducibility of results
Package Loaded version Date Source
Amelia 1.8.0 2021-05-26 CRAN (R 4.1.0)
bookdown 0.24 2021-09-02 CRAN (R 4.1.0)
brms 2.16.1 2021-08-23 CRAN (R 4.1.0)
data.table 1.14.0 2021-02-21 CRAN (R 4.1.0)
devtools 2.4.2 2021-06-07 CRAN (R 4.1.0)
dplyr 1.0.9 2022-04-28 CRAN (R 4.1.2)
dygraphs 1.1.1.6 2018-07-11 CRAN (R 4.1.0)
ellipse 0.4.2 2020-05-27 CRAN (R 4.1.0)
Formula 1.2-4 2020-10-16 CRAN (R 4.1.0)
ggpattern 0.2.0 2021-10-11 Github ()
ggplot2 3.3.6 2022-05-03 CRAN (R 4.1.1)
ggthemes 4.2.4 2021-01-20 CRAN (R 4.1.0)
gridExtra 2.3 2017-09-09 CRAN (R 4.1.0)
gtsummary 1.4.2 2021-07-13 CRAN (R 4.1.0)
haven 2.4.3 2021-08-04 CRAN (R 4.1.0)
Hmisc 4.5-0 2021-02-28 CRAN (R 4.1.0)
jtools 2.1.4 2021-09-03 CRAN (R 4.1.0)
kableExtra 1.3.4 2021-02-20 CRAN (R 4.1.0)
knitr 1.39 2022-04-26 CRAN (R 4.1.2)
lattice 0.20-44 2021-05-02 CRAN (R 4.1.1)
lme4 1.1-29 2022-04-07 CRAN (R 4.1.2)
lubridate 1.7.10 2021-02-26 CRAN (R 4.1.0)
mada 0.5.10 2020-05-25 CRAN (R 4.1.0)
Matrix 1.3-4 2021-06-01 CRAN (R 4.1.1)
metafor 3.0-2 2021-06-09 CRAN (R 4.1.0)
mvmeta 1.0.3 2019-12-10 CRAN (R 4.1.0)
mvtnorm 1.1-2 2021-06-07 CRAN (R 4.1.0)
nlme 3.1-152 2021-02-04 CRAN (R 4.1.1)
pander 0.6.4 2021-06-13 CRAN (R 4.1.0)
papaja 0.1.0.9997 2021-10-11 Github ()
plotly 4.10.0 2021-10-09 CRAN (R 4.1.0)
plyr 1.8.6 2020-03-03 CRAN (R 4.1.0)
psych 2.1.9 2021-09-22 CRAN (R 4.1.0)
purrr 0.3.4 2020-04-17 CRAN (R 4.1.0)
RColorBrewer 1.1-3 2022-04-03 CRAN (R 4.1.2)
Rcpp 1.0.8.3 2022-03-17 CRAN (R 4.1.2)
readxl 1.3.1 2019-03-13 CRAN (R 4.1.0)
remedy 0.1.0 2018-12-03 CRAN (R 4.1.0)
reshape 0.8.8 2018-10-23 CRAN (R 4.1.0)
reshape2 1.4.4 2020-04-09 CRAN (R 4.1.0)
rmarkdown 2.11 2021-09-14 CRAN (R 4.1.1)
sessioninfo 1.1.1 2018-11-05 CRAN (R 4.1.0)
stringi 1.7.6 2021-11-29 CRAN (R 4.1.0)
stringr 1.4.0 2019-02-10 CRAN (R 4.1.0)
survival 3.2-12 2021-08-13 CRAN (R 4.1.1)
ThreeWay 1.1.3 2015-09-07 CRAN (R 4.1.0)
tibble 3.1.7 2022-05-03 CRAN (R 4.1.1)
tidyr 1.2.0 2022-02-01 CRAN (R 4.1.2)
usethis 2.0.1 2021-02-10 CRAN (R 4.1.0)

Full Session Info (including loaded but unattached packages — for troubleshooting only)

R version 4.1.1 (2021-08-10)

Platform: x86_64-apple-darwin17.0 (64-bit)

locale: en_US.UTF-8||en_US.UTF-8||en_US.UTF-8||C||en_US.UTF-8||en_US.UTF-8

attached base packages:

  • grid
  • stats
  • graphics
  • grDevices
  • datasets
  • utils
  • methods
  • base

other attached packages:

  • ThreeWay(v.1.1.3)
  • Amelia(v.1.8.0)
  • reshape(v.0.8.8)
  • readxl(v.1.3.1)
  • dygraphs(v.1.1.1.6)
  • metafor(v.3.0-2)
  • purrr(v.0.3.4)
  • lubridate(v.1.7.10)
  • reshape2(v.1.4.4)
  • stringi(v.1.7.6)
  • stringr(v.1.4.0)
  • papaja(v.0.1.0.9997)
  • kableExtra(v.1.3.4)
  • Hmisc(v.4.5-0)
  • Formula(v.1.2-4)
  • survival(v.3.2-12)
  • lattice(v.0.20-44)
  • tidyr(v.1.2.0)
  • dplyr(v.1.0.9)
  • plyr(v.1.8.6)
  • data.table(v.1.14.0)
  • mada(v.0.5.10)
  • mvmeta(v.1.0.3)
  • ellipse(v.0.4.2)
  • mvtnorm(v.1.1-2)
  • devtools(v.2.4.2)
  • usethis(v.2.0.1)
  • pander(v.0.6.4)
  • tibble(v.3.1.7)
  • sessioninfo(v.1.1.1)
  • gtsummary(v.1.4.2)
  • jtools(v.2.1.4)
  • nlme(v.3.1-152)
  • lme4(v.1.1-29)
  • Matrix(v.1.3-4)
  • ggpattern(v.0.2.0)
  • gridExtra(v.2.3)
  • plotly(v.4.10.0)
  • RColorBrewer(v.1.1-3)
  • haven(v.2.4.3)
  • ggthemes(v.4.2.4)
  • ggplot2(v.3.3.6)
  • psych(v.2.1.9)
  • brms(v.2.16.1)
  • Rcpp(v.1.0.8.3)
  • bookdown(v.0.24)
  • remedy(v.0.1.0)
  • knitr(v.1.39)
  • rmarkdown(v.2.11)

loaded via a namespace (and not attached):

  • estimability(v.1.3)
  • msm(v.1.6.9)
  • coda(v.0.19-4)
  • multcomp(v.1.4-18)
  • rpart(v.4.1-15)
  • inline(v.0.3.19)
  • generics(v.0.1.2)
  • callr(v.3.7.0)
  • TH.data(v.1.1-0)
  • proxy(v.0.4-26)
  • chron(v.2.3-56)
  • tzdb(v.0.1.2)
  • webshot(v.0.5.2)
  • xml2(v.1.3.2)
  • httpuv(v.1.6.3)
  • StanHeaders(v.2.21.0-7)
  • assertthat(v.0.2.1)
  • xfun(v.0.30)
  • hms(v.1.1.1)
  • jquerylib(v.0.1.4)
  • bayesplot(v.1.8.1)
  • evaluate(v.0.15)
  • promises(v.1.2.0.1)
  • fansi(v.1.0.3)
  • igraph(v.1.2.6)
  • DBI(v.1.1.1)
  • tmvnsim(v.1.0-2)
  • htmlwidgets(v.1.5.4)
  • horst(v.0.1)
  • tensorA(v.0.36.2)
  • stats4(v.4.1.1)
  • ellipsis(v.0.3.2)
  • crosstalk(v.1.1.1)
  • backports(v.1.4.1)
  • V8(v.3.4.2)
  • insight(v.0.17.0)
  • markdown(v.1.1)
  • RcppParallel(v.5.1.4)
  • vctrs(v.0.4.1)
  • remotes(v.2.4.0)
  • sjlabelled(v.1.1.8)
  • abind(v.1.4-5)
  • cachem(v.1.0.6)
  • withr(v.2.5.0)
  • checkmate(v.2.0.0)
  • emmeans(v.1.6.3)
  • xts(v.0.12.1)
  • prettyunits(v.1.1.1)
  • mnormt(v.2.0.2)
  • svglite(v.2.0.0)
  • cluster(v.2.1.2)
  • lazyeval(v.0.2.2)
  • crayon(v.1.5.1)
  • labeling(v.0.4.2)
  • pkgconfig(v.2.0.3)
  • pkgload(v.1.2.4)
  • nnet(v.7.3-16)
  • rlang(v.1.0.2)
  • lifecycle(v.1.0.1)
  • miniUI(v.0.1.1.1)
  • colourpicker(v.1.1.0)
  • sandwich(v.3.0-1)
  • polycor(v.0.7-10)
  • mathjaxr(v.1.4-0)
  • modelr(v.0.1.8)
  • cellranger(v.1.1.0)
  • distributional(v.0.2.2)
  • rprojroot(v.2.0.3)
  • matrixStats(v.0.60.1)
  • datawizard(v.0.4.0)
  • loo(v.2.4.1)
  • boot(v.1.3-28)
  • zoo(v.1.8-9)
  • base64enc(v.0.1-3)
  • gamm4(v.0.2-6)
  • ggridges(v.0.5.3)
  • processx(v.3.5.3)
  • png(v.0.1-7)
  • viridisLite(v.0.4.0)
  • parameters(v.0.17.0)
  • rootSolve(v.1.8.2.2)
  • readr(v.2.0.2)
  • jpeg(v.0.1-9)
  • shinystan(v.2.5.0)
  • ggeffects(v.1.1.1)
  • scales(v.1.2.0)
  • memoise(v.2.0.0)
  • magrittr(v.2.0.3)
  • threejs(v.0.3.3)
  • compiler(v.4.1.1)
  • rstantools(v.2.1.1)
  • snakecase(v.0.11.0)
  • cli(v.3.3.0)
  • ps(v.1.7.0)
  • Brobdingnag(v.1.2-6)
  • htmlTable(v.2.2.1)
  • MASS(v.7.3-54)
  • mgcv(v.1.8-36)
  • tidyselect(v.1.1.2)
  • forcats(v.0.5.1)
  • mixmeta(v.1.1.3)
  • projpred(v.2.0.2)
  • highr(v.0.9)
  • yaml(v.2.3.5)
  • latticeExtra(v.0.6-29)
  • bridgesampling(v.1.1-2)
  • sass(v.0.4.0)
  • tools(v.4.1.1)
  • lmom(v.2.8)
  • parallel(v.4.1.1)
  • rstudioapi(v.0.13)
  • foreign(v.0.8-81)
  • gld(v.2.6.2)
  • posterior(v.1.1.0)
  • farver(v.2.1.0)
  • sjPlot(v.2.8.9)
  • digest(v.0.6.29)
  • shiny(v.1.6.0)
  • broom(v.0.8.0.9000)
  • performance(v.0.9.0)
  • later(v.1.3.0)
  • httr(v.1.4.2)
  • rsconnect(v.0.8.24)
  • effectsize(v.0.6.0.1)
  • sjstats(v.0.18.1)
  • colorspace(v.2.0-3)
  • rvest(v.1.0.1)
  • brio(v.1.1.3)
  • fs(v.1.5.0)
  • splines(v.4.1.1)
  • Scale(v.1.0.4)
  • rematch2(v.2.1.2)
  • expm(v.0.999-6)
  • ltm(v.1.1-1)
  • Exact(v.3.0)
  • renv(v.0.14.0)
  • shinythemes(v.1.2.0)
  • systemfonts(v.1.0.2)
  • xtable(v.1.8-4)
  • jsonlite(v.1.8.0)
  • nloptr(v.1.2.2.2)
  • rstan(v.2.21.2)
  • testthat(v.3.1.4)
  • nFactors(v.2.4.1)
  • gt(v.0.3.1)
  • R6(v.2.5.1)
  • pillar(v.1.7.0)
  • htmltools(v.0.5.2)
  • mime(v.0.12)
  • glue(v.1.6.2)
  • fastmap(v.1.1.0)
  • minqa(v.1.2.4)
  • DT(v.0.19)
  • class(v.7.3-19)
  • codetools(v.0.2-18)
  • pkgbuild(v.1.2.0)
  • utf8(v.1.2.2)
  • bslib(v.0.3.0)
  • curl(v.4.3.2)
  • DescTools(v.0.99.43)
  • gtools(v.3.9.2)
  • shinyjs(v.2.0.0)
  • desc(v.1.4.1)
  • munsell(v.0.5.0)
  • e1071(v.1.7-9)
  • broom.helpers(v.1.4.0)
  • sjmisc(v.2.8.7)
  • gtable(v.0.3.0)
  • bayestestR(v.0.12.1)